7

Is your production a multi server farm? I think you are facing the following issue: http://blogs.msdn.com/b/calvarro/archive/2011/11/06/sharepoint-2010-amp-visual-studio-2010-error-ocurred-activate-features-feature-with-id-installed-in-this-farm-cannot-be-added-to-this-scope.aspx It turns out that VS 2010 internally implements a call to the method ...


4

Use GLOBAL as TemplateName. <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <FeatureSiteTemplateAssociation Id="{464b78de-c14e-4c88-bd52-00136fc899f4}" TemplateName="GLOBAL" /> </Elements> See Feature/Site Template Association


3

Technical Details Feature stapling is implemented through a Feature that is specifically designed to staple other Features to one or more site definitions. Feature stapling allows a Feature to be stapled to any new sites created from any site definition or from specific site definitions based on the template name identified in the appropriate WEBTEMP.xml ...


3

Feature stappling simply means having a list of features to activate everytime a certain site definition is used (or in natural language stating "Do activate these features when any of the Site definition ID is created"). Basically there is always a Stappler (the actual feature linking one or more site definion ID with the actual features) and a Staplee (...


3

We had the same problem. We had a stapling feature that was applying branding to my personal sites. Staplers code ran, but MDS was still active. What we did, was to add a custom control to a personal site master page which deactivated MDS when site was loaded. In this custom control we added if/else check if this code ran once ( by putting value to web....


3

If I remember correctly the flow is: Site Collection Scoped Features Web Scoped Features Lists Modules Your stapled features would be shot in after Site collection scoped features or Web scoped features (depending on scope) and hence the lists is not guaranteed to be created before the lists. Found a source here: http://blogs.msdn.com/b/chrischiaro/...


3

Based on your comment, create a separate feature for page provisioning and add it in FeatureSiteTemplateAssociation after the lists are created and put the feature which adds XsltListViewWebPart third in the order. So by the time the code in feature activated event of third feature is called both Lists and Pages will be available.


3

I found the solution. Forgot to publish the content type and run the timer job (content type hub & subscriber). After that everything worked! I don't have to run the timerjobs in the feature (code), it works without it!


2

I also faced the same issue. Please make sure that the feature id that you have mentioned in feature stapler must be exactly same as feature id by which you are deploying your event receiver. Please check the below post "http://weblogs.asp.net/sreejukg/apply-custom-theme-to-sharepoint-2013-mysite-using-feature-stapling" Point to be noticed in the above ...


2

By looking into your code, i think the problem is item.Delete(); item.Update(); You are updating item after you are deleting, there is no need to update the item after delete. You can not update a deleted item.


2

Can you apply your theme via the UI? Is your feature activated/deployed on your blog? The .master needs to be in the blog web in under _catalogs/masterpage. Also make sure you configured your FeatureStapling correct - Blog is not the same site template as the other sites. Here's a example: <?xml version="1.0" encoding="utf-8"?> <Elements ...


2

There is n o restriction as such that both the features should be in same project. It is always good practice to keep a separate project for site columns/content types/List & Libraries.Below are the points to be kept in mind while creating feature stapling: Staplee feature should be having higher scope than stapled feature. eg: if stapled feature is ...


2

you have to give correct feature id. i had the same problem when i referred that post and almost worked for 2 days. now that you have already deployed, now even if you change feature id, it will not work properly. Now do the fresh project and provide correct feature id.


2

We had the same problem couple of months ago, after digging too much we open a MSFT case. Here how we solve it. After updating the wsp, we check if new dll deployed. We also check if updated DLL loaded Recycle the SharePoint timer services on all servers. We use the decompiler tool to find which assembly loaded. In our case, even after updating( many time ...


2

I can suggest you two blogs which I just read because I was planning to do the same as you are. What is feature stapling and how to achieve it here. How to create a list with data whenever a site is created here. Apart from that feature stapling is quite powerful, whatever can be done through feature object model, i.e. feature activation, deactivation can ...


1

I found out the answer to this... It was a mistake on my part. Notice the NamespaceURI and FormUrls <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms"> <FormUrls xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url"> The NamescapeURI was missing the /url in the http link. After ...


1

Stapling only affects new Sites. You can use PowerShell to iterate all your sites and activate your MasterPage Feature Ge-SPWebApplication "your web app url" | Get-SPSite -Limit all | %{ Enable-SPFeature -ID "<Your Feature ID>" -Url $_.Url }


1

PowerShell below will update the current farm “MDSFeature” XML to disable for all newly created site collections and child webs. If you need to support IE8 and older browsers this can be helpful. The feature GUID technically remains active but won’t do anything with missing DLL assembly detail. After desktops upgrade (IE11/Win8) then this change can be ...


1

Since you want to apply master page to all sites within a web application and a web application can have several site collections and each site collection can have many sub sites. So, here is how I will go about it. Create a site collection feature which uploads master page to library. Create a web scoped feature (staplee feature). This feature will check ...


1

You shouldn't use Site definitions and use Web templates instead, because of future upgrades and the fact that MS no longer support site definitions . In case you have custom features, you could write them at proper places in the onet.xml file. Association of you custom feature to onet.xml can be done easily as you might know from site definition development....


1

Figured this one out as well. I added the code (entire control code) for the navigation bar that is on all other sites to the My Sites as well. I got this from the v4.master masterpage. I then hid the navigation bar that My Sites has in my CSS and styled the new control (the one I added) according to my my other sites. I had to create a sitemap for this ...


1

Treasury_MySites.PrivacyStatement.PrivacyStatement is the WebPart Greg is adding to the default.aspx of the MySites. You should replace that with the WebPart you want to add and then set all the properties to the wanted values.


1

You must create site definition and then add some part of text to onet.xml file look at <SiteFeatures> and <WebFeatures> part : <?xml version="1.0" encoding="utf-8"?> <Project Title="SiteDefinitionTitle" Revision="2" ListDir="$Resources:core,lists_Folder;" xmlns:ows="Microsoft SharePoint"> <NavBars> <NavBar Name="$...


1

looks like it has been a while since you posted this. anyway, for the purpose of future reference, my suggestion is first, to always check the template id of a newly created site, so that there is no doubt that the association is correct (web.WebTemplate + web.Configuration) then, perhaps you want to use a farm scoped solution for the stapler, instead of ...


1

I know this is an old question but I hope this might offer an alternative. The alternative is to get the first user who hits the page fire the event to add your navigation. Create a Control Template called Initialiser.ascx. It has a public property galled FeatureGuid. Inside the Page Load event you perform the work of adding the navigation. Elevate ...


1

SPWeb.Features only contains activated features. If you call web.Features[myfeatureid]; on a web that does not have that feature activated then it will blow up in the exact manner you describe. Updated with code - you want something like this: if (oWeb.Features[id] != null) { oWeb.Features.Remove(id); } (The looping I had talked about before was ...


Only top voted, non community-wiki answers of a minimum length are eligible