Saturday, 19 July 2014

Sign a dll using Visual Studio command prompt

1. Open command prompt from Visual Studio (any version)
2. Enter the following command in console:
 sn -k keyPair.snk
3. Obtain MSIL from your dll (ex: MyApp.dll) using below command:
 ildasm myTest.dll /out:myTest.il
4. Re-Assemble the above il code using your strong-name key (genrated in 2nd step) using below command:
  ilasm myTest.il /res:myTest.res /dll /key:keyPair.snk /out:myTestSN.dll
Your signed assemly should be ready now.
For verification you can use following command:
sn -vf myTestSN.dll