简体   繁体   English

从第三方来源还原NuGet软件包

[英]Restore NuGet package from 3rd party source

I tried to use command-line nuget to restore NuGet package, like: 我尝试使用命令行nuget还原NuGet软件包,例如:

nuget restore BuptAssistant.sln

But I used some packages from 3rd NuGet package source. 但是我使用了3rd NuGet软件包源中的一些软件包。 In Visual Studio, I can use Options - NuGet Package Manager - Package sources to set another package source, in command-line, how to do it? 在Visual Studio中,我可以使用Options - NuGet Package Manager - Package sources包源在命令行中设置另一个程序包源,该怎么做?

Error log can be seen in Travis CI 可以在Travis CI中看到错误日志

Create a Nuget.Config file in the same directory as your solution ( .sln ): 在您的解决方案( .sln )所在的目录中创建一个Nuget.Config文件:

<?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/"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM