Thursday, August 23, 2012

Activating Features using PowerShell does not trigger feature event code

If you ever try to activate a feature using powershell, and the code the feature was supposed to run doesnt run (or it runs, but doesnt reflect your changes) consider this- PowerShell, much like IIS, scans the GAC when it is started and caches the assemblies there. If you redeployed your code with modifications to your feature event handler (or anything else) and use an already open powershell window, the code will fail or will run the old version of the code, because it is cached.

Lesson learnt: always close the powershell window and open a new one when deploying a package...

No comments: