Two machines. Both with .NET 3.5 and the VS 2008 VC++ SP1 redistributables
A single exe which uses two signed DLLs, one in C++/CLI and one in C#
The exe load
In my case, I had the same issue with Visual Studio 2015
and I already had signed the assembly.
I fixed it by this way: Right click on the project which causes the issue -> "Properties" -> "Build" -> Change the value of the "Platform target" field.
I had to change it from Any CPU
to x86
but I guess that in function of the project and the library which is failing, you should change its value to x64
.
If someone can't find 64-bit version of sn.exe
, check here:
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools\x64\sn.exe
I encountered this today and stumbled across http://timgeerts.blogspot.co.uk/2009/08/strong-name-validation-failed.html, which seems to be the solution.
Option 1) Turn off code coverage (in VS 2010, go to Test Settings -› Data and Diagnostics -› Untick the "Enabled" box next to Code Coverage).
Option 2) Add the signing key file to the code coverage configuration (in VS 2010, go to Test Settings -› Data and Diagnostics -› select Code Coverage and click on "Configure" at the top. This corresponds to the "keyFile" attribute for the CodeCoverage tag in the .testsettings file.)
In VS 2012, code coverage is enabled by default. It can be disabled through a .runsettings file with an appropriate exclusion. See http://msdn.microsoft.com/en-us/library/jj159530.aspx for more information and a sample file. For option 2, although there doesn't seem to be an explicit setting available in the .runsettings file, the right thing seems to happen automatically with regard to signing (YMMV). However, if you're referencing a VS 2010 .testsettings file then it will need editing as above.
I am working with VS.Net Ultimate 2012
and this solution helped me:
Right click on Project-> properties-> Build Tab-> switch Generate serialization assembly to off-> done
You must use the 64-bit version of sn.exe on a 64-bit machine. (C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\x64\sn.exe)
You might be able to bypass this on development by going into the project settings -> Signing -> and unchecking "Sign the assembly".
I ran into this today while debugging against a source code copy of the Entity Framework.