Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Conversation

@jnm2
Copy link
Contributor

@jnm2 jnm2 commented Feb 15, 2017

[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.

}

[ComImport, ComConversionLoss, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("9FD93CCF-3280-4391-B3A9-96E1CDE77C8D")]
private interface IClrStrongName
Copy link
Contributor Author

@jnm2 jnm2 Sep 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future readers: this is a bad interface declaration because COM interface calls are made in .NET not by method name but rather method declaration order inside the interface. There are 16 missing method declarations that should have come lexically above StrongNameSignatureGeneration. Therefore the first slot number is used instead of the seventeenth, and so, in spite of its name, the COM call ends up being to GetHashFromAssemblyFile instead of to StrongNameSignatureGeneration .

See the fix: #49

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants