2
votes

In my simple ASP.net webservice I get the NuGet "assembly outside lib folder" warning in 2 scenarios:

  1. For a library referenced in my project
  2. For my main project assembly

The DLLs do actually get packaged in the nupkg file (in the /content and /tools folder, respectively).

How should I configure my project?

  1. Copy the 2 DLL files into a /lib folder?
  2. Move the 2 DLL files from their current location into a /lib folder?
  3. Something else?

I have checked the answer to the nuget-assembly-outside-lib-folder question.

Build dumps below

Library referenced in my project warning:

[10:20:34][pack] Issue: Assembly outside lib folder.
[10:20:34][pack] Description: The assembly 'content\(referenced library).dll' is not inside the 'lib' folder and hence it won't be added as reference when the package is installed into a project.
[10:20:34][pack] Solution: Move it into the 'lib' folder if it should be referenced.

Main project assembly warning:

[10:20:34][pack] Issue: Assembly outside lib folder.
[10:20:34][pack] Description: The assembly 'tools\(my assembly).dll' is not inside the 'lib' folder and hence it won't be added as reference when the package is installed into a project.
[10:20:34][pack] Solution: Move it into the 'lib' folder if it should be referenced.

I find it odd that the default build process for a simple ASP.NET project should package files in a non-compliant way when the .nuspec file has not been tampered with.

1
It depends :) What do are using the .dlls for and should they be added as assembly references in the project that uses the NuGet package? The NuGet.org page has information on what things should go in what folders - docs.nuget.org/docs/creating-packages/…Matt Ward
possible duplicate of NuGet Assembly outside lib folderhazzik

1 Answers

4
votes

I added an answer to the referenced question as well, but you can have your build server build the .dll files in the normal folders, then use nuget pack against the .csproj file instead of the .nuspec file. It will pick up the info in the .nuspec file, but it seems to find the assemblies better with help from the .csproj file. Something like:

nuget pack simple.csproj -IncludeReferencedProjects