I created an empty Project and used the default Feature1 thats created with the project to then create the following:

    public override void FeatureActivated(SPFeatureReceiverProperties properties)
        AddProjectList apl = new AddProjectList();

All this does is creates a website called Example.

Now the issue here, is that if I place this code in Feature1.EventReciever.cs and run the application not only does the event feature NOT appear in Manage Features but it also does not run the code, thus the site is never created.

How ever if I create a new Feature, Feature2 and place the code in feature2.EvenetReciever.cs and run the code again, the site is created and the feature shows up in Manage Features.

Why? Why can I not use Feature1 for all this?

Score For the Feature

<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/">

This XML is in BOTH Feature1 and Feature2. how ever only Feature 2 Shows up for activation or deactivation while Feature One has all the Webparts associated with the solution.

  • What's the scope of the feature? Could you post the feature.xml for this receiver? – NotVonKaiser Jun 6 '13 at 15:04
  • @JohnCraven updated – TheWebs Jun 6 '13 at 15:08
  • Hmm. Scope is a required field for the feature.xml file, and in fact VS will add this attribute automatically the first time you open up the feature page (where you specify which modules belong in your feature). Can you maybe try to add that, or else open the Feature1 provisioning page? – NotVonKaiser Jun 6 '13 at 15:12
  • 1
    It it's scoped to site there would be an attribute in that xml file that says Scope="Site". – NotVonKaiser Jun 6 '13 at 15:25
  • 1
    If Scope is set to Site, then the Feature would only show in Manage Site Collection Features, not Manage Site Features. – James Love Jun 6 '13 at 21:55

Your Answer

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

Browse other questions tagged or ask your own question.