Hector Scesa
Hector Scesa

Reputation: 93

Restore dotnet with local feed

I have a solution in visual studio 2015 configure with a local feed of nuget (C:\nuget.feed) that works inside visual studio 2015 because i config the nuget repository enter image description here

But when i want to restore on the build throw command line with Jenkins i don't know how to specify the local feed.

I use dotnet restore and dotnet build to do this with asp net core 1.0.

Upvotes: 0

Views: 1658

Answers (1)

Set
Set

Reputation: 49779

From dotnet restore documentation:

In order to restore the dependencies, NuGet needs the feeds where the packages are located. Feeds are usually provided via the NuGet.config configuration file. A default configuration file is provided when the CLI tools are installed. You specify additional feeds by creating your own NuGet.config file in the project directory.


You also specify additional feeds per invocation at a command prompt:

-s|--source <SOURCE>

Specifies a NuGet package source to use during the restore operation. This overrides all of the sources specified in the NuGet.config file(s). Multiple sources can be provided by specifying this option multiple times.

If you are interesting why dotnet restore doesn't use your VS configuration, look into Nuget Config file locations and uses section.

Upvotes: 2

Related Questions