dotnet发布“无法加载源https://api.nuget.org/v3/index.json的服务索引”

时间:2017-10-18 09:41:27

标签: .net-core

我收到错误消息

Unable to load the service index for source https://api.nuget.org/v3/index.json'

执行dotnet 发布。利用本地NuGet存储库(Artifactory),dotnet restore工作正常。我运行此系统的系统没有互联网连接。但为什么dotnet发布到nuget.org?有没有办法防止这种情况发生?

D:\tools\dotnet\dotnet.exe publish proj.sln --configuration Release --output bin/Release/PublishOutput
D:\tools\dotnet\sdk\2.0.0\NuGet.targets(102,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json[D:\buildAgent_adetca06\work\5a1e5e99f083b612\proj.sln]
D:\tools\dotnet\sdk\2.0.0\NuGet.targets(102,5): error : An error occurred while sending the request. [D:\buildAgent_adetca06\work\5a1e5e99f083b612\proj.sln]
D:\tools\dotnet\sdk\2.0.0\NuGet.targets(102,5): error : The operation timed out [D:\buildAgent_adetca06\work\5a1e5e99f083b612\proj.sln]

我的.NET环境

dotnet --info
.NET Command Line Tools (2.0.0)

Product Information:
 Version:            2.0.0
 Commit SHA-1 hash:  cdcd1928c9

Runtime Environment:
 OS Name:     Windows
 OS Version:  6.3.9600
 OS Platform: Windows
 RID:         win81-x64
 Base Path:   D:\tools\dotnet\sdk\2.0.0\

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0
  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

1 个答案:

答案 0 :(得分:1)

更新至2.0.5即可解决此问题。