NuGet Assembly outside lib folder

Viewed 51130

I'm going to bang out a couple of questions here...first, with NuGet is it possible to create a package from a few DLLs? There is no visual studio project, just the command line and a couple of pre-compiled DLL files.

Second, assuming that is possible, why do I continuously get the "Assembly outside of the lib folder" warning? I've tried everything I can think of to get associated assemblies to add themselves as references inside of the NuGet package.

My file structure looks like this

 Root
   - File1.dll
   - lib
     - File2.dll
     - File3.dll

When I tell NuGet to pack it using a .nuspec like this

<?xml version="1.0"?>
<package >
  <metadata>
    <id>File1.dll</id>
    <version>1.0.0</version>
    <authors>thisguy</authors>
    <owners>thisguysmom</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>This is some library</description>
    <releaseNotes>Porting to NuGet</releaseNotes>
    <copyright>Copyright 2012</copyright>
    <references>
      <reference file="File2.dll" />      
      <reference file="File3.dll" />
    </references>
  </metadata>
</package>

I receive that warning. From what I'm reading, I shouldn't even have to define the references node in any of my projects, as the lib folder items should automatically be added as references?

Does anyone out there understand this NuGet mess?

8 Answers

If dependencies or libraries have been changed, old files affect the packaging operation.

  1. Remove obj and bin folders from project.
  2. Run dotnet restore
  3. Run nuget pack yournuspecfile.nuspec -properties Configuration=Release -IncludeReferencedProjects or your command whatever.
Related