Error occurred in deployment step ‘Retract Solution’: The language-neutral solution package was not found.
I often encounter this error when deploying SharePoint 2010 or 2013 solutions with Visual Studio and it doesn’t go away easily unless I use Solution #4 below.
The reason for this error has something to do with Visual Studio caching. Visual Studio seems to mistakenly believe the solution is already in the solution store and tried to retract it. SharePoint Central Admin thought differently (see System Settings > Manage Farm Solutions and your failing solution probably isn’t there).
Some say since the error is caused by a mere Visual Studio caching issue, simply closing and restarting Visual Studio can fix it. However this has never worked for me. This post logs all possible fixes for the error that I have found. I highly recommend going straight to Solution #3 and #4 (most reliable solution(s) in my opinion).
Solution #1
Delete the following folders from the project directory (in Visual Studio, right-click on the project in the Solution Explorer and select Open folder in Windows Explorer).
- bin
- obj
- pkg
Now perform an IISRESET. You can do this by running the IISRESET command in PowerShell or like this:
Goto Start Menu > Run > type IISRESET and press ENTER
Solution #2
- Right-click your project in Visual Studio and choose Package
- Create a PowerShell script containing the following:
* Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction “SilentlyContinue”
* Add-SPSolution -LiteralPath “[PATH TO WSP].wsp” -Confirm:$false - Retry the deployment from Visual Studio
Solution #3
- In PowerShell running as Administrator run the Uninstall-SPSolution cmdlet:
Unistall-SPSolution -identity {Name of WSP File} -allwebapplications - In PowerShell running as Administrator run Remove-SPSolution cmdlet:
Remove-SPSolution -identity {Name of WSP File} -force
Solution #4
In PowerShell running as Administrator run the Delete() command:
(Get-SPSolution {NameOfWSPFile.wsp}).Delete()
Note: The brackets are part of the command.
This last solution is a quick and dirty (and highly reliable) way to fix this issue. I have found it to work even when all else fails.
However, I still recommend that you first perform the steps in Solution #3 before resorting to Solution #4.
Leave a Reply