I have a C++ project, set to /clr
, which is referenced by C# projects in the same solution. Unfortunately, it seems the C++ doesn't get properly signed, leading to the error message "assembly doesn't have a strong name." (sn.exe
agrees with that error.)
However, there is an snk file in the project settings (Linker/Advanced), so it should be signed. Further, all project settings seem to be the same as in another C++ project in the same solution - where everything works.
The one thing I have found after tearing my hair over this for hours:
When eliminating the /NOLOGO
switch for the linker, it becomes apparent that the linker is called twice. I don't have the slightest idea why that might be.
Now, in the project that works the linker gets passed the snk file in the command line (/KEYFILE:
) for both invocations, in the one that does not work, the second invocation does not get the snk file passed.
Why would the linker be invoked twice? What determines that it doesn't get the snk file passed in the second invocation?
Ok, I found the solution: Apparently, MS blew the SP1 release for VS2010 and you have to go and mess around in the MSBUild installation folder. Here is an article giving the dirty details.
(And why this would work in one project, but not in the other I have no idea. And, frankly, I've lost enough hours banging my head against this wall already, and will not investigate any further.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With