dotnet / ILMerge

ILMerge is a static linker for .NET Assemblies.
MIT License
1.23k stars 170 forks source link

Basic tests, fixes and better logging for keyfile crashes #3

Closed jnm2 closed 7 years ago

jnm2 commented 7 years ago

[Per email conversation.]

There wasn't a test project, so I added one.

I removed the deprecated StrongName DllImports, replacing GetPublicKey with StrongNameKeyPair.PublicKey and replacing StrongNameSignatureGeneration with ICLRStrongName's method. This fixes the mscorsn loading crashes when running as x64 and is under test in ConsoleTests.cs and KeyTests.cs.

I also fixed another crash when the keyfile blob is unreadable. Instead, the exception message is passed to the log with helpful information. This is also under test in KeyTests.cs.