Click here to Skip to main content
15,798,066 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a bunch of C++/CLI projects and the need is to Strong name/Sign them, so that they can be pushed to the GAC.

I have done the following, I use VS2013.

1. Generated the *.snk file using the SN.exe utility.
2. In the C++/CLI project's property setting, I have set the Key file attribute in the Linker->advanced page, to the snk file generated in step 1.
3. Created a post build event to sign the assembly using the command line Sn -Ra [Assemblyname] [Snkfilename].

After the three above steps, I built the project. I tried pushing the recently built DLL to GAC using Gacutil, only to see the error "[AssemblyName] doesn't represent a strongly named assembly". I believe the DLL was not signed properly.

Please let me know, if I am missing any step here.
Also, I read about using the AssemblyInfo.cpp file, have no clarity on their usage. Any help on the matter is appreciated.

Updated 25-Jul-14 10:16am

1 solution

To sign, use the project property page, last tab named "Signing". Check "Sign the assembly", then use "Chose a strong name key file" to choose "<Browse...>" list item. Select your file from file dialog and finalize the signing.

There are many ways to check up is some assembly is signed. One simple way is this: reference this assembly by its module name (using Browse tab of the "Add Reference" window) in some other project. Look at the project file using a text editor — it should show you a strong name of a referenced assembly.

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900