.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Packaging Site Definition

Posted By:      Posted Date: September 13, 2010    Points: 0   Category :SharePoint
Hi All, I need some guidance in how to generate a WSP for custom site definition. I will be migrating site definition from SP 2007 to SP 2010. So far, I have been doing the manual copying for deployment. However, I would like to package everything into WSP so that I can migrate it to 2010 smoothly. I have webtemp files, features, DLLs, CSS files, etc.. Can someone point me to a resource on where to start? Thanks!

View Complete Post

More Related Resource Links

Set Site Icon in Site Definition

Hi,I am trying to set the default Site Icon in my custom site definition.I have changed the titlegraphic.gif in my master page to a new name but that didn't work.In the site definition I have also set the SiteLogoUrl to an image, but that didn't work either.Some people suggest that you should replace the default titlegraphic.gif file with your own image and give it the same name, but I don't see how this could be any good since an update to the sharepoint installation might just overwrite the image again with the default one.Any help would be appreciated!Thanks

Creating a new root Site Collection using a custom site definition file (ONET.XML)

Using Powershell, I am trying to deploy the our custom solution to SP 2010.  The script is doing the following: Deleting the web application using Remove-SPWebApplication Creating a new web application using New-SPWebApplication Adding and deploying a series of WSP files (one of which has the site definition file in it) using Add-SPSolution and Install-SPSolution Create a root site collection based on the site definition file provided in the WSPs using New-SPSite I get the error "WARNING: Template is not found and is not applied." When I run Get-SPWebTemplate, my site definition does not show up. I saw this: http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/5ea46e07-a4b0-4bab-b698-9b6eeb695607 but I want a solution that does not involve me reloading a DLL, as, I feel there is something else I am forgetting. I have also tried: IISReset Resetting the timer service Cleaning the Cache (as described here: http://support.microsoft.com/kb/939308) Nothing seems to work.  Does anyone have any ideas?

Deploying custom 2007 site definition to 2010

For a customer I am upgrading their SharePoint 2007 enviroment to SharePoint 2010. After a succesfull upgrade I am stuck with one last annoying problem: when creating a publishing site collection using a custom definition the provisioning of the site definition  fails. Interesting about this is that the provisioning works from the central admin UI, but this customer has an custom webpart for creating site collections in a web application outside of Central administration. The simplified code for this is: public static bool Create(SPWebApplication webApp, string Url, string siteTitle, string siteDescription, uint lcid, string siteTemplate, string ownerLogin, string ownerName, string ownerEmail)         { SPSite site = null; try { SPSite newSiteCollection = webApp.Sites.Add(Url, siteTitle, siteDescription, lcid, siteTemplate, ownerLogin, ownerName, ownerEmail); newSiteCollection.Close(); newSiteCollection.Dispose(); site = GetRootSite(webApp); bool r = (site != null) ? true : false; return r; } catch { return false; } finally { if (site != null) site.Dispose(); }         } The exception is thrown when webApp.Sites.Add() is executed. The user we are logged in as, as wel the appID, are Farm Admin's. The ULS shows this exception: Exception thrown while fetching field by internal name 'Wiki_x0020_Page_x0020

How to decide whne we should use site definition or site template?

What is the difference between site definition and site template and whne do use site definition and site template?

feature stapling done against site definition breaks when saving site as a template?

Hi, we have a bunch of feature stapling done against some of our site definitions on a solution we are working on. This feature staple has a bunch of feature dependancies which all work in a variety of ways. One of these dependancies then uses a feature receiver class to do some post provisioning setting up of web part connections and the like. This all works very well when creating a new site from a site definition etc etc. The problem arises when a user opts to provision a site in this way, and then uses the 'save as template' function within sharepoint. (BTW this is WSS 3.0 / MOSS). The site template saves correctly, but now the feature receiver never runs. I'm assuming this is because the associated feature staple doesnt run either? I've looked around and seen some reference to feature stapling not working against templates. Is this true? 

Running code after site definition site creation in a event receiver or feature receiver

Hi guys I've got a site definition which is pretty much based on STS.This is it's own sharepoint project. Let's call this project SiteDefProj. Next in another SharePoint project (same solution though). Let's call this CustomListProject. In this project I've got a feature which provisions a bunch of lists based on custom content types - this feature is a site scoped. Let's call this feature: CustomListInstances. I have added a feature receiver to this feature to execute some custom code on the lists themselves (under feature activated) In my ONET.XML (part of the SiteDefProj) I have CustomListInstances feature ID as part of my <sitefeatures>. When I do a create site I can actually step through the code and see it actually being executed but after the site is created the list instances are created but it's like the code never run or did anything. The weird part is that stepping through the code while creating a site collection using my SiteDefProj the code runs great with no errors. All lists are there and the code runs smooth. If I manually create a STS site and activate my feature everything works and the code does actually run and the effects are visible after the feature is created. Again I can actually step through it in debug. My suspicion is that there's some sort of a race condition in the CREATE SITE functionality where maybe the web or site collection hol

SharePoint how does it know to use a feature default.aspx deployed instead of site definition defaul

I have created a feature which deploys a custom default.aspx page. The deployed file goes to the template\features{featureName} directory. How does SharePoint know to use this default.aspx page instead of the one that is located in SiteTemplates{Site Def name} directory?dave

where to specify the master page in site definition?




There are two site definition created. and two master pages for each.

Now when user creates new site definition the respective master pages should be applied automaticaly.

what needs to be done?

What to do if particular site definition should be appeared at particular subsite level only?


What to do if particular site definition should  be  appeared at  particular subsite level only?


Reg: Does Custom site definition created in SharePoint 2007 works in Sharepoint 2010



If one has created a custom site definition in sharepoint 2007, Once the whole site is migrated to sharePoint 2010 will that "custom site definition" created in 2007 will work without breaking in SharePoint 2010?

If No, what has to be done to make it work on 2010.






how to create a site definition from existing site in sharepoint

Hi any one please help me how to create a site definition from existing site in sharepoint. It's very urgent

Thanx in Advanced



custom publishing site definition


What to do , so that  custom   site definition tab  should appear at site collection level only?

What to do , so that  custom   site definition tab  should appear at subsite level only?

what to do , so that particular site definition tab should not appear at particular subsite level at all.

Feature association in site definition( for site and subsite)



in Onet.xml

one configuration --Template  --is for Site collection site definition
second configuration --Template --is for subsite  site definition

when subsite is created with second configuration  receiver Feature
should be activated
I have associated feature  as

<!-- BascBrandGroup -->

FeatureSiteTemplateAssociation Id="AE6860A5-B140-47BB-8FF4-D971FB93D682"

Feature Id and template name is verified.
but feature is not getting activated.

Please suggest better approaches or if sample code for site collection
site def and ( site and subsite) def is available ,pls provide the link

Site Definition Import 2007 - 2010 - navbarlink problem



I have a problem to import a site definition from 2007 to 2010.

In this site definition i have navbar and navbarlink.

In 2007 i could use Resources in navbarlink Url like this :

<NavBar Name="$Resources:CFS,RootSiteDef_Nav_Request;" Url="$Resources:core,lists_Folder;/$Resources:CFS,RootSiteDef_Nav_Request;/" ID="1005">
   <NavBarLink Name="$Resources:CFS,RootSiteDef_Nav_Request_ByStatus;" Url

Site Provisioning Class in Publishing site definition



    I  have tried different ways to write site provisioing class as follows


I  modified  webtemp

ProvisionAssembly="Publishing, Version=, Culture=neutral, PublicKeyToken=assemblyguid"

class CustomPortalProvisioningProvider: SPWebProvisioningProvider
        public override void Provision(SPWebProvisioningProperties properties)
            // apply template using a configuration
           // properties.Web.ApplyWebTemplate("LITWAREPORTAL#0");
            // TODO: add extra code here to customize the new site.


Then I got the error

Failed to instantiate provisioning provider 'PublishingSite.VillageSiteProvision' from assembly 'PublishingSite, Version=, Culture=neutral, PublicKeyToken=0431

Custom site definition for Publishing site





I am trying to create a custom site definition based on publishing site definition. But i get following error while trying to create a site collection based on this definition.


"The Office SharePoint Server Publishing Infrastructure feature must be activated at the site collection level before the Publishing feature can be activated."


below is my custom webtemp:

Code Snippet
<?xml version="1.0" encoding="utf-8" ?>
<Templates xmlnsSurprisews="Microsoft SharePoint">
<Template Name="CustomPUBLISHING" ID="10001" SetupPath="SiteTemplates\PUBLISHING">
    <Configuration ID="0" Title="CUSTOM PUBLISHING Site" Type="0" Hidden="FALSE" ImageUrl="/_layouts/1033/images/PublishingCollaborationSite.gif"
 Description="This template provides a custom publishing site."

custom Picture Library with site definition


How to use Picture Library feature  available at

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\FEATURES\PictureLibrary

to create the custom picture library with  site definition.

custom picture library has one more  column with dropdown values .

After search on google. I found that picture library List to be specified in onel.xml as follows

<configuration >


       -- speciify picture library  list


 here how I can specify my own picture library,Please let me know in exact words


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend