我尝试使用命令行nuget
来恢复NuGet包,例如:
nuget restore BuptAssistant.sln
但我使用了一些来自第三方NuGet软件包源的软件包。在Visual Studio中,我可以使用选项 - NuGet软件包管理器 - 包源
来设置另一个软件包源,在命令行中,如何做到这一点?
错误日志可以在Travis CI中查看。
.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>
或者:
nuget sources Add -Name "MyCustomSource" -source https://yournnugetserver.com/api/v3/
nuget restore MySolution.sln
或者:
nuget restore MySolution.sln -source "https://www.nuget.org/api/v3;https://yournnugetserver.com/api/v3/"