2
votes
Error:
Activate-Feature : Error activating feature …<featurename>……… at …<siteURl>……..The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Issue has caused when using PowerShell script to retract and deploy WSP solution, WSP deploys successfully but somehow it get failed to activate a feature with event receiver I am starting the services as below:

Stop-Service -Name “SPAdminV4”
Start-SPAdminJob
Start-Service -Name SPAdminV4
WaitForSolutionDeploymentJobToFinish $name

Note: I have not found any issue when I do fresh deployment instead retraction/deployment.
I even it works file when I retract the solution in separate script and do deployment with new powershell instance

I have found following references while investigating: http://sisharepoint.wordpress.com/2010/03/26/getting-around-gac-problems-when-you-deploy-sharepoint-solutions-with-powershell/ http://blogs.msdn.com/b/briangre/archive/2011/02/17/sharepoint-2010-visual-studio-solution-deploy-deployment.aspx

Please guide me to resolve this issue

3

3 Answers

0
votes

I have come by this a few times. Unfortunately I have not the time to dive into it further but an application pool recycle seems to fix the issue for me.

0
votes

i have tried to forcefully restart IIS from Powershell script but that didn't help me... So i have found a workaround i have started a new process from current powershell session and carried out rest of the steps from there. it resolved the issue:

Write-Host "Starting new process" Start-Sleep 5 Start-Process powershell.exe -ArgumentList '-NoExit','& S:\powersellscript.ps1' Stop-Process -Id $PID

0
votes

Close and reopen Visual Studio solve the problem to me.