I tried to use command-line nuget to restore NuGet package, like:
nuget restore BuptAssistant.sln
But I used some packages from 3rd NuGet package source. In Visual Studio, I can use Options - NuGet Package Manager - Package sources to set another package source, in command-line, how to do it?
Error log can be seen in Travis CI
Create a Nuget.Config file in the same directory as your solution (.sln):
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://www.nuget.org/api/v3/" />
<add key="MyCustomSource" value="https://yournnugetserver.com/api/v3/" />
</packageSources>
</configuration>
Or:
nuget sources Add -Name "MyCustomSource" -source https://yournnugetserver.com/api/v3/
nuget restore MySolution.sln
Or:
nuget restore MySolution.sln -source "https://www.nuget.org/api/v3;https://yournnugetserver.com/api/v3/"
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