5

MY Task is to generate a NuGet package of one project containing static content and binaries. Then means by which this NuGet package can be consumed in another Project/ Solution.

I have completed the first half of the task where i was able to generate a NuGet package out of a project, but not sure how to consume this inside another project/ solution. I see only option of adding already published Projects from NuGet repository but not anything which is out there on file system/ hard drive.

Any help is appreciated.

Thanks in advance.

Bhargava
  • 329
  • 5
  • 13

1 Answers1

7

You need to add the directory which contains the package as a NuGet Package Source. In Visual Studio do the following

  • Tools -> Options
  • Package Manager -> Package Sources
  • Add the file system location and hit "Update"

After this the local package should appear in the Package Library Manager

If you are looking to change the NuGet.exe command line then create a Nuget.exe.config file and add the following

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="LocalName" value="path/to/your/package" />
  </packageSources> 
</configuration>
JaredPar
  • 733,204
  • 149
  • 1,241
  • 1,454
  • Also is there a way to Specify the common source location for just one solution... i.e setting the default source NuGet location for a solution. – Bhargava Apr 01 '13 at 19:14
  • @user2233274 you can probably do this by having a shared msbuild file and putting the nuget sources in that msbuild file. – JaredPar Apr 01 '13 at 19:15