Skip to content

[SRM] Add APIs to get the AssemblyNameInfo of an assembly definition or reference. #116839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

teo-tsirpanis
Copy link
Contributor

Fixes #113749.

@Copilot Copilot AI review requested due to automatic review settings June 19, 2025 22:23
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds new APIs to obtain an AssemblyNameInfo instance from both assembly definitions and assembly references, complementing the existing GetAssemblyName API. The changes include implementation updates in the core libraries and corresponding tests validating the new API behavior.

  • Adds GetAssemblyNameInfo methods to AssemblyReference and AssemblyDefinition.
  • Enhances MetadataReader to construct AssemblyNameInfo from metadata.
  • Updates tests in AssemblyDefinitionTests.cs to validate AssemblyNameInfo properties.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/libraries/System.Reflection.Metadata/tests/Metadata/TypeSystem/AssemblyDefinitionTests.cs Adds tests validating AssemblyNameInfo for both definitions and references.
src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/TypeSystem/AssemblyReference.netstandard.cs Introduces GetAssemblyNameInfo API for assembly references with proper XML documentation.
src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/TypeSystem/AssemblyDefinition.netstandard.cs Introduces GetAssemblyNameInfo API for assembly definitions with proper flag handling.
src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/MetadataReader.netstandard.cs Adds a new method to create AssemblyNameInfo from metadata components.
src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/AssemblyNameInfo.cs Updates using directives to include System.IO as part of AssemblyNameInfo.
src/libraries/System.Reflection.Metadata/ref/System.Reflection.Metadata.cs Updates the reference assemblies to include the new GetAssemblyNameInfo API.

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jun 19, 2025
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Reflection.Metadata community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[API Proposal]: Add APIs to read the AssemblyNameInfo of an assembly file.
1 participant