If you have a dll library which doesn't have strong name, but you need to put it into Global Assembly Cache (GAC), you must sign it. For this you must first create a key with public and private keys, get MSIL of the dll then compile it by signing with the key.
You need to open Visual Studio Command Prompt (Developer Command Prompt for VS), change directory to the directory where the dll is located, then run the following commands:
sn -k key.snk
by this command a key is being generated
ildasm.exe MyLib.dll /output:MyLib.il
by this command you get the MSIL of the acssembly.
Now you should rename the dll file you used. Then run this command:
ilasm MyLib.dll /dll /output:MyLib.dll /key:key.snk
this command recompiles the library with key.
After this you can put the assembly into GAC by running this command.
gacutil /i MyLib.dll
No comments:
Post a Comment