-
Notifications
You must be signed in to change notification settings - Fork 658
Description
Prerequisites
- I have written a descriptive issue title
- I have searched issues to ensure it has not already been reported
GitVersion package
GitVersion.MsBuild
GitVersion version
6.2.0
Operating system
N/A
What are you seeing?
In GitVersion.MsBuild.csproj, the System.Collections.Immutable package reference is currently placed after the line:
<PackageReference Update="@(PackageReference)" PrivateAssets="All" />
This causes System.Collections.Immutable to be packaged into the runtime NuGet packages, which seems unintended for a build-time-only dependency.
Relevant snippet:
https://github.com/GitTools/GitVersion/blob/d095febb1ec8ccd7ce5e20ab767cb6c6e1ee4412/src/GitVersion.MsBuild/GitVersion.MsBuild.csproj#L16C5-L23C17
Since the Update is applied before System.Collections.Immutable is declared, the PrivateAssets="All" metadata does not apply to it, leading to it being included in the runtime assets.
What is expected?
System.Collections.Immutable
should be marked as a build-time-only dependency using PrivateAssets="All"
, and therefore should not be included in the runtime dependencies of projects that consume GitVersion.MsBuild.
Steps to Reproduce
-
Create a new .NET project.
-
Add a reference to the GitVersion.MsBuild NuGet package.
-
Publish the project and check the output directory to confirm that System.Collections.Immutable.dll is included in the runtime output.
RepositoryFixture Test
No response