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

NU5131 issues #8684

Open
zivkan opened this issue Oct 10, 2019 · 3 comments
Open

NU5131 issues #8684

zivkan opened this issue Oct 10, 2019 · 3 comments
Labels
Category:Quality Week Issues that should be considered for quality week Functionality:Pack Priority:2 Issues for the current backlog. Type:Bug

Comments

@zivkan
Copy link
Member

zivkan commented Oct 10, 2019

NU5131 was added to try to encourage packages that select which assemblies are used by projects to work with both packages.config and PackageReference.

We are currently aware of two issues:

Packages build from MSBuild (no nuspec)

A project that puts a file in ref/<tfm>/ will trigger the warning, therefore asking the package author to create a <references> element in the nuspec. However, the MSBuild pack tasks doesn't provide a way to specify it.

Missing runtime files

See #3830.

@nkolev92
Copy link
Member

I think it's perfectly acceptable to create packages which are only compatible with PackageReference (hence using the ref folder).
Even the docs only call out that scenario:
https://docs.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu5131

Right now this is too noisy and defeats the user trust in the warning.
Lots of people will end up disabling them

@nkolev92 nkolev92 added the Category:Quality Week Issues that should be considered for quality week label Feb 6, 2020
@ericstj
Copy link

ericstj commented Jun 23, 2021

Just noticed this. The warning shouldn't force people to use the <references> section if they are creating a package that has parallel ref/lib folders. It should only tell them to do it if the ref folder has different files than lib.

@UmaHarano
Copy link

Hi,
I am creating a Nuget package that only supports "PackageReference". So I only have dlls in the "ref" folder. When I run "dotnet pack" I get this warning.

c:\program Files\dotnet\sdk\6.0.101\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5131: References were found in the nuspec, but some reference assemblies were not found in both the nuspec and ref folder. Add the following reference assemblies: [C:\...\Nuget.csproj]
c:\program Files\dotnet\sdk\6.0.101\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5131: - Add MyAssembly.dll to the net5.0-windows reference group in the nuspec [C:\...\Nuget.csproj]

My nuspec file looks like this:

 <dependencies>
      <group targetFramework="net5.0-windows">
      </group>
    </dependencies>
  </metadata>
  <references>
    <group targetFramework="net5.0-windows">
      <reference file="MyAssembly.dll" />
 </group>
  </references>
...

The Nuget is created and I am able to successfully use it. But - Any suggestion as to how I can fix these warnings?
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category:Quality Week Issues that should be considered for quality week Functionality:Pack Priority:2 Issues for the current backlog. Type:Bug
Projects
None yet
Development

No branches or pull requests

6 participants