.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

Feature Stapling + on creation of a new site stapling is not effecting + means The resource cannot b

Posted By:      Posted Date: October 18, 2010    Points: 0   Category :SharePoint


i am working on feature stapling. pls find the code below:

http://www.beckybertram.com/oldblog/index.php?p=33&more=1&c=1&tb=1&pb=1  (i had written the code from this site).

after delpoyment of this solution.

problem: while i am creating a site - it is throwing " The resource cannot be found" error.

on log - file not found.

Very 1st site collection is able to apply. but while i am creating newly (after processing , it is thorwing this issue).

pls help me to make this work, i need to complete this by EOD. pls help me.

View Complete Post

More Related Resource Links

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? 

Set default Page Layout using Feature Stapling in SharePoint Site



I need to create custom SharePoint Feature using Visual Studio to set Default Page Layout for the publishing pages created in publishing site/ sub-sites.

Can you please guide me steps to create the custom feature using Visual Studio and how to deploy the same in the site.


Abhijit Sil

Feature Stapling and the FeatureActivated Event in Windows SharePoint Services 3.0

You can attach (or staple) a SharePoint Feature to a site definition without modifying the original site definition. Learn about issues related to using Feature Stapling with the SPFeatureReceiver.FeatureActivated event.

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

Feature with wsp for creating specific groups on any site creation

hi, i need to create a sharepoint feature for wss 3.0 with .wsp (wsp for easy deployment) which do folowing funtionality: Ability to run some custom code for creating specific custom groups on every site creation. Feature needs to be activated when deployed so when user create new site it creates groups based on our custom code( i have custom code for creating gorups just need to know how to attached it to feature which works on every site creation event) Any workable example is very helpful for me because i am very confuse and already did reasearch on that. i guess feature stapling is not the solution in my case. Thanks in advanced shaheen

Feature Stapling in SharePoint 2010 Web Templates


Hi All

We have a new requirement where we have to staple a number of features to a custom web templates. Now when we try to staple the features to the custom web template, they are not getting reflected in the custom web templates.

Is feature stapling allowed in custom Web Templates? Could someone help out in this regard.


- Sridhar Please visit my blog http://sharepointschool.wordpress.com/ for getting started with SharePoint

Feature Stapling + Feature is behaving different in different environments


Hi All,

I am developed the feature stapling as per the requirement. Problem is acting different in different environment.

Development system: windows 7, sharepoint 2010, with visual studio 2010

Testing environment: windows server 2008, sharepoint 2010, with powershell script.

Requirement: need to staple the custom master pages with different site definitions (like mysite, collaboration etc)

Solution Contains: 3 features

1. Feature 1: scope in web level. on activation-custom master will be stapled with concern site types based on the feature existance. on deactivation-custom master page is stapling with earlier master page based on the feature existance. except mysite site types rest of the site types (collaboration meeting ws etc) are applied here.

2. Feature 2: scope in Site level. on activation-custom master will be stapled with concern site types based on the feature existance. on deactivation-custom master page is stapling with earlier master page based on the feature existance. only mysite site types are applied here.

3. Feature 3: scope in web application level. having all the delegate controls and element.xml (with

Automating Site Creation and Feature Activation with PowerShell


I am trying to create a blank site and then loop through the available features for that site and activate them. The problem I am facing is the list of features scoped to "web" that are returned in powershell are not the same list of web features that are visible through the site settings in the SharePoint UI or through the SharePoint 2010 Manager UI.

What I get returned from Powershell is:

DisplayName Id

----------- --

WebPageLibrary 00bfea71-c796-4402-9f2f-0eb9a6e71b18

IssuesList 00bfea71-5932-4f9c-ad71-1557e5751100

WorkflowHistoryList 00bfea71-4ea5-48d4-a4ad-305cf7030140

NoCodeWorkflowLibrary 00bfea71-f600-43f6-a895-40c0de7b0117

SurveysList 00bfea71-eb8a-40b1-80c7-506be7590102

GridList 00bfea71-3a1d-41d3-a0ee-651d11570120

GanttTasksList 00bfea71-513d-4ca0-96c2-6a47775c0119

LinksList 00bfea71-2062-426c-90bf-714c59600103

MobilityRedirect f41cc668-37e5-4743-b4a8-74d1db3fd8a4

workflowProcessList 00bfea71-2d77-4a75-9fca-76516689e21a

TasksList 00bfea71-a83e-497e-9ba0-7a5c597d0107

TeamCollab 00bfea71-4ea5-48d4-a4ad-7ea5c011abe5

AnnouncementsList 00bfea71-d1ce-42de-9c63-a44004ce0104

ObaSimpleSolution d250636f-0a26-4019-8425-a5232d592c01

PictureLibrary 00bfea71-52d4-45b3-b544-b1c71b620109

ContactsList 00bfea71-7e6d-4186-9ba8-c047ac750105

SharePoint 2010 Master page feature stapling - not sure where to put files


I have successfully added a branding feature to my 2010 environment that activates on install. Just as expected, it does not work for subsite creation. I have seen a number of articles/blog posts on how to create a feature stapler for SP2007. However, I am having a hard time finding a working solution for SP2010 using VS2010.

I have a couple of questions that I hope someone can point me in the right direction on:

1. In my project I have a branding feature, this contains the EventReceiver that applies the change. Can I have a second feature here that does the stapling or does it need to be in a completely seperate project?

2. Everything I read points to two files feature.xml and elements.xml, are both of those supposed to be under Features in Solution Explorer or are they located somewhere else or do they need to be create. If they need to be created, where do they belong?

3. In the EventReceiver.cs file there is a GUID that was automatically generated. Is this the GUID referenced in the feature.xml?

Hopefully with these questions answered I can move forward and find a solution to getting the stapler working.




Why do the aks master pages not get applied if the feature is not activated on the top site collecti


I installed AKS 2.0 and activated AKS feature. The problem I found was the aks master pages do not get applied if the feature is not activated on the top site collection. why is so?

example: If i activate the feature on http://<servername>/sites/<sitename> and apply the master page, I dont see any changes.

              But if i activate the same aks feature on http://<servername/ then everything started working on all sites.

              The reason i found is the CSS reference in the aks master pages.

              It reference should be given as follows:

                 for http://<servername>/sites/<sitename> ->  <link rel="stylesheet" type="text/css" href="../../Style%20Library/AKS/Aks_Band_Blueband.css"/>

                 for http://<servername>/ -><link rel="stylesheet" type="text/css" href="/Style%20Library/AKS/Aks_Band_Blueband.css"/>

So my question is, am i missing anything? am i supposed to activate the AKS feature on top level site collection at any cost? if yes, why is so? 

And after applying aks master pages, i see differnece in font sizes. Why the font size is getting changed?


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>





Setting Managed MetaData default values on site creation

I am working on a project where the requirement is to have specific document content types.  I have therefore create a site columns feature which creates all my columns, I have a Site Contentypes feature which creates all my content type and I have list templates based on my content types.  I also have created a couple of Site definition features which create specific list instance based on my list template As part of my content types I have created a few Managed Metadata fields which I wanted to set defaults for on the creation of my sites.  I have therefore created a feature which is right at the end of the WebFeatures section in my ONET.xml.  This features enumerates through all lists, looking for specific column names(managed metadata columns) and looks to set these to specific values.  The code to set the default value on the field is: TaxonomyField documentCategoryField = (TaxonomyField)library.Fields["Document Category"]; if (documentCategoryTerm != null) { documentCategoryField.DefaultValue = documentLibraryDefault.ToString(); documentCategoryField.Update();                                                     }                         &n

Creating a Resource Reservation Site - suggestions on how to accomplish

After some suggestions here for solutions. We upgraded from SharePoint 2007 to SharePoint 2010, and the RoomEquipmentReservations.wsp template stopped working. We knew it might happen - so no shock there. We need a way of allowing staff to view and reserve resources (such as ICT Rooms, Digital Cameras). I have tried using a group calendar, but this has two major issues: I can find no way of having all of the resources shown when the site is accessed, the user has to add them in. When you click a resource after adding them in, it thinks you want to book all of the resources shown. To summarise what we are trying to achieve: A calendar style list showing all resources and any bookings for those resources (gantt style?) The ability to have the user click a free slot on the calendar above and be asked to enter other information about the booking. Once a booking is made, the user who created it. Any suggestions on how best to make all of this happen? As an aside: anyone know if MS are going to be recreating the 40 application templates for SharePoint 2010? Thanks. Craig.

Sharepoint 2010 user creation in a resource forest model

Hi,  We have a setup with Exchange 2007, Sharepoint Services 3.0 - all in the same AD Domain/Forest. Now we have to install sharepoint 2010, but want to do it in a resource forest model. This 'resource forest' model will be forllowed for SharePoint 2010 only, without exchange.  So I have created a new AD domain and installed a SPT 2010 Standard Edition Server, which by itself is working. Now, I need to create Sharepoint Sites and assign user roles to it. The Users will come from the First AD Domain. I have read some blogs on this as well. I have understood the concept at high level. My questions are 1) I should be able to deploy users in resource forest model for Sharepoint 2010 only while their mailboxes continue to work in the current default way. Right ? 2) Would the existing users who are having roles in Sharepoint 3.2.0 in the first domain, be able to get roles in SPT 2010 in resource forest ? In other words they enjoy both 3.2.0 and 2010 simultaneously ? Possible ? 3) I definitely want to automate user creation on SPT 2010 using scripting because I don't see any feature like 'linked mailbox' which does this for Exchange resource forest model. I am wondering what is the best sequence to follow for user provisioning ?      i) I take the user name from the first domain - call it U1     ii) I create a user with similar name

Retract custom master page feature and all site pages stop working

There is a requirement to apply custom branding on personal sites in a SP 2010 project. For this I have created a feature which uploads and applies the custom master page on creation of any new personal sites.   I have stapled this feature (using feature stapling concept) to the “SPSPERS” (personal site) site definition. The custom master page is displayed on the creation of new personal sites. On feature deactivation, I am looping through all the personal sites (as the feature is deployed on a team site) and pointing the master URL back to v4.master. But when I retract the solution and browse to the personal site, I am getting a “404 File not found” error.  But am able to view the settings page by typing the URL.   I activated the publishing features and looked at the master page applied to the personal site. It was pointing to v4.master.   Any help on this is appreciated. Regards, Neha

SharePoint 2007 SP2 - My Site Creation - KB937207

We are experiencing problems with MySite creation.  The symptoms are identical to those described by KB937207: support.microsoft.com/kb/937207/en-gb However, the hotfix will only install on a pre SP1 farm. Any ideas on how to solve this problem?   Thanks.

how to disable creation of security groups as part of site provisioning for out of the box

I have requirements that I would like to create the sites with no security groups. Add users with specific permissions levels. Is there a way to disable the step in the default site provisioning process for out of box templates, that not to ask for creating of the security groups..net Architect
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