nunit/nunit.analyzers

NUnit.Analyzers 3.1 -> 4.1 upgrade doesn't play nicely with Central Package Management

EdLichtman opened this issue · 2 comments

Hi all,

I just validated that no issue, open or closed, contains "Central Package Management" nor "Directory.Packages.props"

When I have a library that uses central package management, and upgrade NUnit.Analyzers from version 3.1 -> 4.1, (or I'm guessing Any -> 4.1), it automatically includes the following PackageReference specifications:

      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

However, it does so in the <PackageVersion>, not in the <PackageReference>.

It seems that if you add it to the <PackageVersion> and NOT the <PackageReference>, the properties do not propogate.

I do think that it should work the way your upgrade updates it. I've opened an issue for this.
NuGet/Home#13358
Perhaps there's nothing to change in the NUnit code for now, but I just wanted to inform you that right now it doesn't work as intended.

Thanks for reporting.
I never use the wizard to upgrade packages, but only update the version numbers in the Directory.Packages.props file.

Note that all this PrivateAssets is not needed at all as the NUnit.Analyzers package is marked as a developer package.

As this has nothing to do with the analyzer but with the VS wizard I will close the issue here.