![](/img/trans.png)
[英]How can I use GPR and nuget.org sources in my dotnet project via GitHub Actions?
[英]Restoring nuget packages of project with the http version of nuget.org using the dotnet cli
我正在嘗試dotnet restore
我的.net核心項目,但是我無法從當前工作站訪問http s ://api.nuget.org/*(因此該命令只是超時),無法訪問http ://api.nuget。 org / *是可能的。
有沒有辦法使dotnet
cli使用nuget.org的http版本?
您可以在您的存儲庫中創建一個NuGet.Config
文件(或使用dotnet new nugetconfig
創建它)並添加以下供稿:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="http://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
您也可以更新全局NuGet.Config文件以進行匹配。 它位於* nix上的~/.nuget/NuGet/NuGet.Config
和Windows上的%APPDATA%\\NuGet\\NuGet.Config
中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.