0

SharePoint 2010 question.

My 1st goal is to add some custom themes to site collections when they're created. I have this working with a simple 2 feature stapling solution (Themes.Feature, Staple.Feature). For now it's stapled to just STS#0.

When I create a new STS#0 site collection, it has the 2 custom themes.

Now I want to extend this and set the theme of the root web to one of the custom themes.

I added a feature receiver to the Themes.Feature and deployed with no code modifications (i.e. the .CS file has just the commented out template code). Now when I create a new Site Collection I get this error: Object reference is not set to an instance of an object. And the Site Collection is not created.

Is it possible to use a feature receiver like this?

1

I was able to get this to work by putting the Stapler and the Staplee features in different solutions. This allowed me to deploy the feature being stapled separate from the stapling feature.

Works like a champ.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.