views:

389

answers:

2

All that I'm trying to do is deploy a simple web application-scoped feature that is activated automatically when you install it. Just to make sure that none of our corporate customizations were doing anything weird I even created a simple test web application feature and built it with WSP builder, but I still get the same results - the feature installs fine but is NOT activated by default. I've also set "AutoActivateInCentralAdmin" to true but it does nothing. Is this something that can even be done or am I wasting my time? Here is my feature XML:

<?xml version="1.0" encoding="utf-8" ?>
<Feature Id="21003D96-D88E-42ed-AF97-2C4C22BFA3CF"
      Title="Test Web Application Feature"
      Description="I should be activated by default."
      Version="1.0.0.0"
      Scope="WebApplication"
      Hidden="false"
      xmlns="http://schemas.microsoft.com/sharepoint/"
      ActivateOnDefault="true"
      AutoActivateInCentralAdmin="true"
      AlwaysForceInstall="true">
</Feature>
+4  A: 

Hi Repo

The ActivateOnDefault attribute is only used for Features with Farm Scope, which by default are automatically activated, but where you can turn that off by specifying ActivateOnDefault as False

The AutoActivateInCentralAdmin works with all other scopes, but only activates the feature on the CentralAdmin (WebApp, Site or RootWeb)

If you want your Feature with WebApp scope automatically activated on all WebApps then you need to have a FarmLevel feature which has a feature receiver that loops through and activates it on all web apps, but that'll not include future WebApp If you want to include future webapp then you need to use Feature Stapling with a feature with Site/Web scope which activates the WebApp feature if not already activated.

Per Jakobsen
+1  A: 

as per said, feature staping is the way to go.

Colin