Monday, September 25, 2017

Add-SPSolution : This solution contains one or more assemblies targeted for the global assembly cache


Exception

Add-SPSolution : This solution contains one or more assemblies targeted for the global assembly cache. You should use a strong name for any assembly that will be in the global assembly cache. At line:1 char:1 + Add-SPSolution + ~~~~~~~~~~~~~~ + CategoryInfo : InvalidData: (Microsoft.Share...dletAddSolution:   SPCmdletAddSolution) [Add-SPSolution], SPException + FullyQualifiedErrorId :Microsoft.SharePoint.PowerShell.SPCmdletAddSolutIon


 


I have encountered this error when I deploy my SharePoint solution (wsp) to SharePoint farm as a global assembly.
This error is due to not singing the project before deploy.

Solution:
Go to project properties of the SharePoint project.




















Then select an existing signing key or create a new one to sign and build the project.



Now you can Build the project again and try using Add-SPSolution, which should work fine.



Post a Comment