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

Invalid warning "Assembly outside lib folder." in dotnet pack #5655

Closed
mellinoe opened this Issue Jul 27, 2017 · 5 comments

Comments

Projects
None yet
4 participants
@mellinoe

mellinoe commented Jul 27, 2017

Product Information:
Version:            1.0.1
Commit SHA-1 hash:  005db40cd1
OS Name:     Windows
OS Version:  10.0.15063

Detailed repro steps so we can see the same problem

  1. Create a csproj with something like following packaging options:
<Content Include="..\..\deps\cimgui\win7-x64\cimgui.dll">
  <PackagePath>runtimes/win7-x64/native</PackagePath>
  <Pack>true</Pack>
</Content>
  1. Run dotnet pack

See https://github.com/mellinoe/ImGui.NET for a real-world project this affects.

Results

The following bogus warning is generated:

warning : Issue found with package 'ImGui.NET'.
warning : Issue: Assembly outside lib folder.
warning : Description: The assembly 'runtimes/win7-x64/native\cimgui.dll' is not inside the 'lib' folder and hence it won't be added as reference when the package is installed into a project.
warning : Solution: Move it into the 'lib' folder if it should be referenced.

NuGet should not be warning about this, because it is not invalid. The assembly in question is a native assembly (a PInvoke target for the main managed assembly being packaged), and should not be referenced directly from consumers of the nuget package.

@terrajobst mentioned to me that setting NoPackageAnalysis=true can be used to silence this warning, but I would probably rather not set that in case there are other, legitimate problems that could be detected.

Is there any other way that this warning can be silenced?

@emgarten

This comment has been minimized.

Collaborator

emgarten commented Jul 27, 2017

Is there any other way that this warning can be silenced?

That is currently the only way to turn off the warning. Pack could potentially use NU codes to allow disabling these on a per issue basis.

@mellinoe

This comment has been minimized.

mellinoe commented Oct 3, 2017

@rohit21agrawal Which release will this be fixed in?

@terrajobst

This comment has been minimized.

terrajobst commented Oct 11, 2017

That is currently the only way to turn off the warning. Pack could potentially use NU codes to allow disabling these on a per issue basis.

Please do that. It makes sense for 80% of packages but as we're also using NuGet more and more for tooling (i.e. templates and global tools) those warnings will become a nuisance. Given them individual IDs allows suppressing them individually and also give folks a unique way to search for them.

@rohit21agrawal: I assume you fixed this specific issue; should I file a general feature requests for outputting IDs?

@rohit21agrawal

This comment has been minimized.

Contributor

rohit21agrawal commented Oct 11, 2017

@mellinoe 15.4 should have this fix
@terrajobst yes, that would be great! ping @rrelyea for prioritizing this

@mellinoe

This comment has been minimized.

mellinoe commented Oct 26, 2017

I'm on 15.4 and this still happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment