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

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

Site Provisioning Class in Publishing site definition

Posted By:      Posted Date: September 30, 2010    Points: 0   Category :SharePoint


    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

View Complete Post

More Related Resource Links

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.

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."

Provisioning: Use Web Services Provisioning to Control Access, Usage, and Billing on Your Site


Building Web Services to provide enterprise-level solutions is only the first step. You need to take care of the infrastructure aspects of your solution as well, including provisioning, billing, security, and reporting. In this article, the author uses the .NET Framework and SQL Server 2000 to design a provisioning system that will take care of all these housekeeping tasks. He discusses the general requirements of a Web Service provisioning system, walks through the implementation, and then outlines various scenarios for putting this system to work.

Chandu Thota

MSDN Magazine December 2002

Why feature with event receiver doesn't activate properly after site provisioning?



I have defined feature with event receivers for my document library and for users List .

I try to activate my feature in onet.xml in section <WebFeatures>. After provisioning a new site from onet.xml  all work fine and my feature is shown as activated, but event receivers doesn't fire. It fires only after reactivating my feature (deactivate, then activate it again). But I need my feature works immediately after site provisioning without deactivating and activating it again. Who knows how to solve this problem?

part of ONET.xml



        <Feature ID="00BFEA71-4EA5-48D4-A4AD-7EA5C011ABE5"/>

        <!-- TeamCollab Feature -->

        <Feature ID="F41CC668-37E5-4743-B4A8-74D1DB3FD8A4"/>

        <!-- MobilityRedirect -->

        <!--My EventReceivers Feature-->

        <Feature ID ="41178843-A6A4-47c7-9EF9-B8A432E02B88"></Feature>





Publishing SharePoint Site


I have published a sharepoint website that I created but I now have the following problem:

  • from the internal network, everything works fine..
  • from the external network (via web):

  1. the People Picker web part does not work (error in WebForm_DoCallBack)
  2. The "assigned to" field is empty, but when I see the source code, the users are there. They are just not displayed.
Can anyone help me. Thanks in advance..

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

SharePoint 2010 Publishing Site : Operation is not valid due to the current state of the object.

  I think as usual, the new version of SharePoint 2010 has a lot of problems. the below messege appear in a publushing site (FBA) enabled and when I try to access the pages list or even approve a page of accessing the SiteCollectionImages list and ......... etc every link produce the below error. I'm very frustrated with 2010.  Server Error in '/' Application. <nativehr>0x8107058a</nativehr><nativestack></nativestack>Operation is not valid due to the current state of the object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: <nativehr>0x8107058a</nativehr><nativestack></nativestack>Operation is not valid due to the current state of the object. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [COMException (0x8107058a): <nativehr>0x8107058a</nativehr><nativestack></nativestack>Operation is not valid due to the current state of the object.] Microsoft.SharePoint.Library.SPR

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?

Publishing site template saved using /_layouts/savetmpl.aspx

A trick we used in MOSS 2007 doesn't seem to work in SharePoint 2010 although it seemed to work for someone who asked the same question in this forum.  We know publishing site do not have the "Save as site template" as an option in the site settings so we used <site>/_layouts/savetmpl.aspx to save the site template.  Unfortunately, new site created using the saved template is throwing a 404 error.  And the site was actually created (can see in View All Site Content).  We need to be able to easily create sub-sites with the same look and feel and set of document libraries/lists.  Any advice? 

override a css class in site

Hi, I have created a custom web part which i have deployed on as blog site . It uses the .ms-wpbody css class from main.css. But when i change the admin links css it also changes the css for the custom web part. I need to know is there a way the custom web part can custom css  and not the default. Is there a way to change the custom web part  css without  writing code.  

How to add List item in search results for anonymous in a publishing site?

Hi all,   For now, results in Library (document set or not) are shown and the link is the binary file. This is ok. But for list, anonymous users can't view results. As logged in I see the items in the AllItems.aspx page. How could I allow this result to be viewed by anonymous users too?      Thank you,   Benoit Pironet

Publishing Site as www.contoso.com

Hello, I am looking to make a publishing site the web site for the company. When I go to www.contoso.com it will take me to the normal Moss 07 portal and not the publishing site. Where is the setting for me to make the publishing site as the default web site? -IRXFIRE

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?

How do I delete the 'Home' tab from the top nav for a publishing site?

I have a request to remove the 'Home' tab from the top navigation for a publishing site.  I can see how to add new ones and remove them but there is no way to remove the root 'Home' tab from the site navigation settings page.Thanks...

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? 

Packaging Site Definition

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!
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