Radi Atanassov

SharePoint MCM, MVP, MCT and owner of OneBit Software

“Activate on Default” confusion and features scoped at Web Application level

When creating SharePoint features in Visual Studio 2010, one of the settings that defaults to True is “Activate on Default”.

image

There is a lot of confusion as to what this setting actually does:

  • It ONLY applies to features scoped at Farm and Web Application levels. You can still modify it for other features, but it doesn’t do anything.
  • Any feature (Farm or WebApplication) with that setting set to True will automatically activate when you deploy the WSP solution, no matter which way you deploy it (Install-SPSolution, stsasm.exe, Central Administration)

This setting is not related to the deployment configuration settings in Visual Studio 2010:

clip_image001

These features will still activate, even if VS’s deployment configuration is set to “No Activation”.

Where can this be an inconvenience?

When you create features that deploy Timer Jobs at the Web Application level, you really want to have “Activate on Default” set to False. Otherwise, your feature will be activated on ALL web applications. I did some tests and found out that even if your WSP Solution is not global and is deployed to a specific Web Application, your feature will still get activated. Dangerous, you really want your Timer Jobs to be running where they are meant to run, i.e. don’t deploy Timer Jobs to Central Administration unless you really need to.

If you are ever trying to find out why your Timer Jobs are “attached” to all web applications, this might be why.

Код от SharePoint Development Days – Jan 2010

Ето Ви линк към пълният код от събитието: SharePointBG.PM.Full.zip

Скриптовете имат хард-коднат път – C:\Projects\SharePointBG.PM.

Ще Ви трябва WSPBuilder за да можете да отворите решението в Visual Studio.

Презентацията и документа можете да ги намерите на този блог пост: SharePoint Development Days Jan 2010

Ако имате въпроси, не се колебайте да ми пишете.

Поздрави!