How I do a sign an assembly that has already been built into a dll specifically flute.dll

Stephen Lacy picture Stephen Lacy · Sep 4, 2009 · Viewed 18.8k times · Source

The reason I want to sign the dll is because I want to add it to the Global Assembly Cache. The assembly is a css parsing engine written in Java and ported to J#. I use VS2008 so I can't make J# projects. It doesn't have a strong name key assigned to it and I have no idea how to do it now that it's built.

Anyone have any ideas?

Answer

PJ8 picture PJ8 · Sep 4, 2009

After a little searching, I found this post that explains one way of doing it.

Exerpt:

From a VS.NET command prompt, enter the following:

  1. Generate a KeyFile: sn -k keyPair.snk
  2. Obtain the MSIL for the provided assembly: ildasm providedAssembly.dll /out:providedAssembly.il
  3. Rename/move the original assembly: ren providedAssembly.dll providedAssembly.dll.orig
  4. Create a new assembly from the MSIL output and your assembly KeyFile: ilasm providedAssembly.il /dll /key=keyPair.snk