Skip to content

AssemblyNameParser has duplicated ProcessorArchitecture.MSIL checks #127172

Closed

Description

@colejohnson66

AssemblyNameParser.TryParseProcessorArchitecture has a duplicated branch for MSIL:

private static bool TryParseProcessorArchitecture(string attributeValue, out ProcessorArchitecture result)
{
result = attributeValue switch
{
_ when attributeValue.Equals("msil", StringComparison.OrdinalIgnoreCase) => ProcessorArchitecture.MSIL,
_ when attributeValue.Equals("x86", StringComparison.OrdinalIgnoreCase) => ProcessorArchitecture.X86,
_ when attributeValue.Equals("ia64", StringComparison.OrdinalIgnoreCase) => ProcessorArchitecture.IA64,
_ when attributeValue.Equals("amd64", StringComparison.OrdinalIgnoreCase) => ProcessorArchitecture.Amd64,
_ when attributeValue.Equals("arm", StringComparison.OrdinalIgnoreCase) => ProcessorArchitecture.Arm,
_ when attributeValue.Equals("msil", StringComparison.OrdinalIgnoreCase) => ProcessorArchitecture.MSIL,
_ => ProcessorArchitecture.None
};
return result != ProcessorArchitecture.None;
}

Line 336 is already covered by line 331.

Activity

  1. assigned and unassigned on Apr 20, 2026
  2. added
    untriaged
    on Apr 20, 2026
  3. dotnet-policy-service commented on Apr 20, 2026

    @dotnet-policy-service
    Contributor

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

  4. added a commit that references this issue on Apr 21, 2026
    81d6754
  5. jkotas commented on Apr 21, 2026

    @jkotas
    Member

    Thank you for the report!

  6. removed
    untriaged
    on Apr 21, 2026
  7. locked and limited conversation to collaborators on May 21, 2026
  8. added a commit that references this issue on Jul 15, 2026
    fa1c78b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions