SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

share|improve this answer
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.

share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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