SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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