BWG
BWG

Reputation: 2278

Use packages.config to install local NuGet package?

I want to install a NuGet package (so a .nukpg file) that I have stored in a directory. This is easy to do with a batch script, using the NuGet command line, but is there a way to do this using the built in "packages.config" file?

Upvotes: 3

Views: 3608

Answers (1)

bratsche
bratsche

Reputation: 2674

Yes, you can reference a local file from your packages.config. You need to update your NuGet.Config file and add something like this to the <packageSources> section:

<packageSources>
  <add key="MyLocalPackages" value="external/packages" />
</packageSources>

value is the path to where your packages can be found.

Then in your packages.config just reference the version that is in your local package directory, like:

<package id="Foobar" version="1.1.5-alpha" targetFramework="net45" />

Upvotes: 2

Related Questions