簡體   English   中英

使用dotnet cli使用nuget.org的http版本還原項目的nuget軟件包

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM