I'm struggling to add new NuGet source to store private packages. I have already tried to add config into my .csproj like this post suggests
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="Artifactory-DEV" value="https://theluggage-agct.gray.net/artifactory/api/nuget/nuget-institutional-development-local" protocolVersion="3"/>
</packageSources>
</configuration>
I also tried this but was not able to find an equivalent in dotnet nuget.
nuget sources Add -Name "MyServer" -Source \myserver\packages
OBS: I'm not using Visual Studio 2017 and currently using Ubuntu.
It's a shame that the user ffa didn't post their comment as an answer, because it's correct. The XML is supposed to be in a file named nuget.config.
Also, if you have a newish dotnet SDK/CLI installed, you can also run dotnet new nugetconfig and it will create the file from a basic template for you. NuGet docs have some information about how settings are applied if you care, but generally people put their nuget.config files in the root of their repository, or in the same place as their .sln file.
There is another way.
dotnet add package <PACKAGE> -s <SOURCE>
The problem is that I need to add -s every single time I want to add a package from a certain private repo.
EDIT: See "imps" comment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With