Skip to content

Remove unused System.Reflection.Metadata reference#377

Open
jonathanpeppers wants to merge 1 commit into
mainfrom
jonathanpeppers/remove-reflection-metadata
Open

Remove unused System.Reflection.Metadata reference#377
jonathanpeppers wants to merge 1 commit into
mainfrom
jonathanpeppers/remove-reflection-metadata

Conversation

@jonathanpeppers
Copy link
Copy Markdown
Member

The System.Reflection.Metadata namespace isn't actually used in Files.cs, and the matching PackageReference in MSBuildReferences.projitems adds an unnecessary dependency to this project. Drop both.

The $(SystemReflectionMetadataPackageVersion) MSBuild property is intentionally left in place since downstream consumers (e.g. dotnet/android) may still rely on it.

Changes

  • Remove using System.Reflection.Metadata; from Files.cs
  • Remove the System.Reflection.Metadata PackageReference from MSBuildReferences.projitems
  • Keep the $(SystemReflectionMetadataPackageVersion) property for downstream use

Verified with a clean build of Microsoft.Android.Build.BaseTasks.

The System.Reflection.Metadata namespace is not actually used in Files.cs, and the corresponding PackageReference in MSBuildReferences.projitems is not needed by this project. Remove both, but keep the $(SystemReflectionMetadataPackageVersion) property since downstream consumers may still rely on it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 27, 2026 20:57
jonathanpeppers added a commit to dotnet/android that referenced this pull request May 27, 2026
Picks up dotnet/android-tools#377 which removes the unused System.Reflection.Metadata PackageReference from Microsoft.Android.Build.BaseTasks. This stops BaseTasks from constraining SRM to the 11.0.0-preview version pinned in this repo, unblocking NU1605 errors in downstream consumers (e.g. android-platform-support) that reference SRM 10.0.3 directly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

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 removes an unnecessary dependency from Microsoft.Android.Build.BaseTasks by dropping an unused using directive and removing the corresponding System.Reflection.Metadata PackageReference from the shared MSBuild references import, while intentionally keeping the version property for downstream consumers.

Changes:

  • Remove using System.Reflection.Metadata; from Files.cs.
  • Remove System.Reflection.Metadata PackageReference from MSBuildReferences.projitems.
  • Retain $(SystemReflectionMetadataPackageVersion) property for downstream use.

Reviewed changes

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

File Description
src/Microsoft.Android.Build.BaseTasks/MSBuildReferences.projitems Removes the System.Reflection.Metadata package dependency while keeping the version property.
src/Microsoft.Android.Build.BaseTasks/Files.cs Removes an unused using directive.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants