Inconvenient class-naming with feature receiver and scope=”Farm”

Posted by Eric Bartels

Writing feature receivers during SharePoint customizing a common task. Depending on the scope your features belongs to your code looks similar to the following: public override void FeatureActivated(SPFeatureReceiverProperties properties) { // Scope="Web" SPWeb web = properties.Feature.Parent as SPWeb;   // Scope="Site" SPSite site = properties.Feature.Parent as SPSite;   // Scope="WebApplication" SPWebApplication app = properties.Feature.Parent as [...]

Setting the MasterPage during feature activation sometimes works but not always?

Posted by Eric Bartels

One of my current projects had the requirement to modify certain properties of the SharePoint “Look and feel”. To make updates and improvements easy I created a custom masterpage which is provisioned via a Feature. A custom feature receiver takes care of setting the masterpage and a feature staple takes care of newly created webs. [...]