1

I like to call FeatureInstalled method of feature after the FeatureActivated method. How can I call FeatureActivated method from FeatureInstalled?

I have a module in feature and it will adding the module after the FeatureActivated method call. So, I'm facing the issue because I have added pagelayout in my module and on FeatureActivated method I'll creating page from page layout but module is no added in site so it will give error for that's why I like to call FeatureInstalled and in this method the page is creating from pagelayout.

  • How did you deploy the feature ? WSP Install-SPSolution or did you add the feature after it was installed already with Update-SPSolution ? – Cameron Verhelst Jul 15 '14 at 9:17
  • Install feature – Sameer Vaghela Jul 15 '14 at 9:28
  • Why can't you simply add the module BEFORE activating FeatureActivated ? – Cameron Verhelst Jul 15 '14 at 9:31
  • but it should be automatically....I don't want to add module manually – Sameer Vaghela Jul 15 '14 at 9:39
  • It can be automatically. It seems to me you're making upgrades to an existing environment. The feature is new, so why can't the module be inside the feature. This way it's always deployed before your code runs. – Cameron Verhelst Jul 15 '14 at 9:41

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.