Using ILMerge to merge strongly named assemblies into a single strongly named assemly in .Net

2.4k views Asked by At

If all .Net assemblies are strongly named with the same key pair i.e same .snk file, then will ILMerge utility auotmatically strong name the final assembly with same key pair when merging all these assemblies, OR one needs to specify the .snk file in the ILMerge command as in command snippet below?

I was assuming that there is no need to specify the .snk file if all files involved have been strongly named with same .snk file.

ilmerge /out:Merged.dll Primary.dll Secondary1.dll Secondary2.dll /keyfile:sg.snk
1

There are 1 answers

0
Gluck On BEST ANSWER

To strong-name an assembly (and to make sure only the original author can do so), one needs the private key (snk). ILMerge (or any tool that generates or modifies an assembly) also needs it.

Otherwise anyone could modify (and re-sign) an assembly, which defeats the signing purpose (guarantee authorship).