Skip to content

Conversation

@jkotas
Copy link
Member

@jkotas jkotas commented May 10, 2022

Fix typo in AssemblyName handling and add test that catches the bug introduced by the typo

Fix typo in AssemblyName handling and add test that catches the bug introduced by the typo
@ghost ghost assigned jkotas May 10, 2022
@ghost
Copy link

ghost commented May 10, 2022

Tagging subscribers to this area: @dotnet/area-system-reflection
See info in area-owners.md if you want to be subscribed.

Issue Details

Fix typo in AssemblyName handling and add test that catches the bug introduced by the typo

Author: jkotas
Assignees: jkotas
Labels:

area-System.Reflection

Milestone: -

@jkotas jkotas merged commit 9b0b0d0 into dotnet:main May 10, 2022
@jkotas jkotas deleted the assemblyload-bug branch May 10, 2022 23:03
Assembly a = Assembly.Load(an);

byte[] publicKey = a.GetName().GetPublicKey();
Assert.True(publicKey.Length > 0);
Copy link
Member

Choose a reason for hiding this comment

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

do the public key and PKT have defined lengths (eg., 8 and 160) and if so, could we assert the lengths of each here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, they do. We have AssemblyName tests that verify that.

This test only requires that the public key and public key token are non-empty to cover the desired scenario.

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

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

LGTM

@ghost ghost locked as resolved and limited conversation to collaborators Jun 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants