Richard Comish
Richard Comish

Reputation: 197

Dot net core on mac package restore source

I'm trying to install a package from a private repository on a dot net core application that I'm building on a Mac. What I can't find is anywhere that I can specify where dotnet restore should be looking for packages.

How can I specify where restore should be looking?

Thanks,

Richard.

Upvotes: 0

Views: 645

Answers (2)

cwishva
cwishva

Reputation: 1978

Add a "NuGet.Config" File to the Folder level where your Solution file is present (.sln)

Note : ".nuget" folder should not be committed and does not used by the latest nuget.

It will look like below

<?xml version="1.0" encoding="utf-8"?>

<configuration>
  <solution>
    <add key="disableSourceControlIntegration" value="true" /> // Optional 
  </solution>
  <packageSources>
    <add key="NuGet official package source" value="https://nuget.org/api/v2/" />
    <add key="My custom Package" value="http://Custom Domain/nuget" />
  </packageSources>

</configuration>

Upvotes: 1

Richard Comish
Richard Comish

Reputation: 197

Should have spent another 10 minutes poking around - the answer seems to be ~/.nuget/NuGet/NuGet.Config contains the configuration for restoring packages.

Upvotes: 1

Related Questions