I get the following problem activating a feature in powershell:

Enable-SPFeature : The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I can activate the feature just fine through VS (by deploying the solution) as well as the browser.

The feature has feature receiver code. I have another feature (with feature receiver) which activates just fine through Powershell.

Any ideas?


I had this problem today when I tried to deploy in my development environment. I tried to retract. But it didn't help. In my case somewhere it failed to remove dll from GAC. So I deleted my dll from GAC (C:\Windows\assembly) and the deploy worked.

By the way, I ran iisreset /noforce before being able to delete the dll file.

  • I tried taking the dlls out of GAC but to no avail. I don't know what exactly happened but I came back to work the next day and everything is working fine... One of many SharePoint mysteries... – Emon Sep 28 '11 at 20:50
  • :) Fun that it worked. Sharepoint is really a mystery. – Anatoly Mironov Sep 29 '11 at 9:17
  • exactly wich dll we're talking about ? – Shenging Feb 14 '14 at 17:33
  • Your dll, the dll that is deployed through your custom wsp. – Anatoly Mironov Feb 16 '14 at 23:38

First thing I do is close my PowerShell window & open a new instance, this works almost every time. If not I move onto restarting SPTimerv4 & IISreset, retract & deploy. if its still a no go I rebuild my package and manually remove the existing files.


Try running restart-service SPTimerV4 before you do your solution add/deploy and feature activation. This article by Bjørn Stærk describes the problem and the solution.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.