Skip to content
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

dotnet add package adds inappropriate metadata to Directory.Packages.props #13438

Open
AArnott opened this issue May 13, 2024 · 3 comments
Open
Labels
Priority:2 Issues for the current backlog. Product:dotnet.exe Type:Bug

Comments

@AArnott
Copy link
Contributor

AArnott commented May 13, 2024

NuGet Product Used

dotnet.exe

Product Version

8.0.204

Worked before?

No response

Impact

It's more difficult to complete my work

Repro Steps & Context

I ran the following command line in the directory of an SDK style csproj where CPVM is turned on:

dotnet add package MessagePackAnalyzer --version 3.0.54-alpha

This added the following xml to my csproj:

    <PackageReference Include="MessagePackAnalyzer">
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>

That looks good. But it also added the following xml to my Directory.Packages.props:

    <PackageVersion Include="MessagePackAnalyzer" Version="3.0.54-alpha">
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
    </PackageVersion>

PackageVersion items are not expected to have the metadata that the tool added, are they?

Verbose Logs

No response

@jeffkl
Copy link
Contributor

jeffkl commented May 15, 2024

@AArnott you are correct, dotnet add package should not be adding that metadata to the <PackageVersion /> item. It looks like this would only happen for packages marked as a development dependency? Does that sound right?

@AArnott
Copy link
Contributor Author

AArnott commented May 15, 2024

Yes, that would explain how it hasn't been reported before.

@AArnott
Copy link
Contributor Author

AArnott commented Dec 13, 2024

This is still broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:2 Issues for the current backlog. Product:dotnet.exe Type:Bug
Projects
None yet
Development

No branches or pull requests

2 participants