Remove unused System.Reflection.Metadata reference#377
Open
jonathanpeppers wants to merge 1 commit into
Open
Conversation
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>
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>
Contributor
There was a problem hiding this comment.
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;fromFiles.cs. - Remove
System.Reflection.MetadataPackageReferencefromMSBuildReferences.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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
System.Reflection.Metadatanamespace isn't actually used inFiles.cs, and the matchingPackageReferenceinMSBuildReferences.projitemsadds 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
using System.Reflection.Metadata;fromFiles.csSystem.Reflection.MetadataPackageReferencefromMSBuildReferences.projitems$(SystemReflectionMetadataPackageVersion)property for downstream useVerified with a clean build of
Microsoft.Android.Build.BaseTasks.