locked
Activating a new feature with scope "Web" RRS feed

  • Question

  • Dear All,

    I have installed and deployed a solution named "XYZ". It has a feature with scope:'Web'.

    The "XYZ.wsp" is shown in Solution Management of Central Administration with 'Globally Deployed' in "Deployed To" section.

    I have activated the "XYZ" feature within different sites as the scope of the feature is 'Web'.

    Now i have retracted and removed the solution from Solution Management.

    No if i again install\deploy\add solution to solution store. It executes successfully.

    But the problem is:

    If i again go to those sites where i had activated the feature. It shows me feature activated.
    I want that the feature should be deactivated and i should activate the feature again.

    Can anybody please help me.

    Regards,
    Gaurav Arora
    • Edited by KrishnasPad Friday, June 26, 2009 6:25 PM Fixing thread title bug
    Monday, June 15, 2009 7:33 AM

Answers

All replies

  • Hi,

    "You must deactivate features before uninstalling them unless they are WebApplication scoped or Farm scoped Features."
    Installing or Uninstalling Features
    (http://msdn.microsoft.com/en-us/library/ms442691.aspx)

    If you need the features deactivated after re-deployment, then I'm afraid you should deactivate your features before retraction, either manually, using STSADM (deactivatefeature, http://technet.microsoft.com/en-us/library/cc262680.aspx), or from code.

    For the latest option you can check this article:
    Activating and Deactivating Features Programmatically
    http://blog.u2u.info/DottextWeb/patrick/archive/2006/06/13/23454.aspx

    Peter
    Monday, June 15, 2009 8:25 AM
  • Thanks Peter,

    Can you tell me

    When re-deploying the feature, from where it gets the previous state?

    Do you understand what i want to ask?

    Regards,
    Gaurav Arora
    Monday, June 15, 2009 8:47 AM
  • Hi,

    It would require some SQL database investigation, but I think when you retract the solution without deactivating the features first, the feature states remain in the database as a reference to guid of the original features. You may not see it on the user interface, since probably SharePoint does not show them up when detecting the missing features, but it may not smart enough (or it is by design?) to clear the reference.

    When you re-deploy the features, the zombie features wake up from the existing references.

    But it's only my personal opinion without any scientific background or experience on the very exact situation.

    Peter
    Monday, June 15, 2009 10:08 AM