Nuget package not adding reference with custom package

May 20, 2011 at 3:23 PM
Edited May 20, 2011 at 3:52 PM

I created a nuspec file:

 

    <?xml version="1.0"?>
    <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
      <metadata>
        <id>MyPackage.dll</id>
        <version>3.5</version>
        <authors>Me</authors>
        <owners>Me</owners>
        <requireLicenseAcceptance>false</requireLicenseAcceptance>
        <description>The description</description>
        <tags>tag1</tags>
      </metadata>
    </package>

 

In a directory with the file strucutre

 

  - MyPackage
    - Assemblies
      - MyPackage.dll
    - MyPackage.nuspec

 

I created my package using `nuget.exe pack myPackage.nuspec` and placed it in my local sources. I can find and install it from visual studio at which point 

  • The dll IS copied into the packages directory 
  • But the reference is NOT added to the project 
  • Repositories.config is NOT created 
  • Packages.config is NOT created

What am I missing?

 


Double-posted on StackOverflow if you want rep-points:

 

http://stackoverflow.com/questions/6064943/nuget-package-not-adding-reference-on-custom-package

Developer
May 20, 2011 at 3:54 PM

Try replacing the 'Assemblies' folder with 'lib'.

May 20, 2011 at 4:04 PM
dotnetjunky wrote:

Try replacing the 'Assemblies' folder with 'lib'.

That worked thanks!

The documentation needs to be updated, it says to use 'Assemblies' here: http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#From_a_convention_based_working_directory

Coordinator
May 20, 2011 at 4:25 PM

I am updating the docs now. Thanks!

May 20, 2011 at 4:26 PM

No problem, thanks for the great product guys.