Andy Joiner
Andy Joiner

Reputation: 6541

NuGet "assembly outside lib folder" - ASP.NET - copy or move the file?

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.

Upvotes: 2

Views: 6686

Answers (1)

Prof Von Lemongargle
Prof Von Lemongargle

Reputation: 3768

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

Upvotes: 3

Related Questions