There are times when you need a DLL to have a strong name; putting it in the GAC for example. With 3rd party DLL's this could be a pain. This is how you do it:

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

1. Generate a KeyFile

sn -k keyPair.snk

2. Get the MSIL for the assembly

ildasm SomeAssembly.dll /out:SomeAssembly.il

3. Rename the original assembly, just in case

ren SomeAssembly.dll SomeAssembly.dll.orig

4. Build a new assembly from the MSIL output and your KeyFile

ilasm SomeAssembly.il /dll /key= keyPair.snk

Where do these tools live

If you've not got your framework and sdk paths properly mapped... In framework 2 this is where the command line utilities live:

  • C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ilasm.exe
  • C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\ildasm.exe
  • C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sn.exe

 

相关文章:

  • 2022-12-23
  • 2022-01-01
  • 2021-10-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-27
猜你喜欢
  • 2021-09-04
  • 2022-02-01
  • 2022-12-23
  • 2022-12-23
  • 2021-10-15
  • 2021-12-25
  • 2022-12-23
相关资源
相似解决方案