Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Web scoped SPFeatureReceiver only works in the RootWeb

  Asked By: Sade    Date: Aug 10    Category: Sharepoint    Views: 2211

Has anyone else experienced this issue before?

I have created an assembly with a class that inherits from the
SPFeatureReceiver class. I have tried placing my code in both the
FeatureActivated and FeatureInstalled methods with the same result -
when I deploy the feature and assembly it all runs as expected when
feature is installed/activated on the RootWeb of the site
collection. However, when I install/activate the feature on any sub
webs the code is not executed.

I've tried debugging the FeatureReceiver on the RootWeb and that
worked fine. I've then created sub webs in the same session (so I
know I am attached to the assembly) and when I install/activate the
feature the same break points are never hit?!

I'm wondering if the issue is that I created the assembly in Visual
Studio 2008 (compiled against .NET 2.0) or if it just the VM I am
using. I am firing up another VM to test against and will try
porting the code over to Visual Studio 2005 but in the meantime
wondered if anyone might have experienced this before?



1 Answer Found

Answer #1    Answered By: Lester Casey     Answered On: Aug 10

All the web  scoped feature  receivers I've created  in the past work on
top level or child sites.

Didn't find what you were looking for? Find more on Web scoped SPFeatureReceiver only works in the RootWeb Or get search suggestion and latest updates.