毕竟,我很快发现了我遗漏的2个问题:
- 我曾经
sudo -i
以root用户身份运行以尝试解决问题,结果是我在 home文件夹中设置的NuGet配置没有被使用。 - 回到我自己的登录,然后出现错误:
error: Unable to load the service index for source https://theluggage-agct.gray.net/artifactory/api/nuget/nuget-institutional-development-local.
error: The content at 'https://theluggage-agct.gray.net/artifactory/api/nuget/nuget-institutional-development-local’ is not a valid JSON object.
error: Unexpected character encountered while parsing value: <. Path ‘’, line 0, position 0.
原来,我们的Artifactory NuGet回购返回的XML符合NuGet
v2。我更改了配置文件,将存储库设置为v2,现在可以正常工作了。因此,从上方在以下位置编辑文件
home<user>.nugetNuGetNuGet.Config
添加新的回购URL,并正确获得版本设置:
<?xml version="1.0" encoding="utf-8"?><configuration> <packageSources> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> <add key="Artifactory-DEV" value="https://theluggage-agct.gray.net/artifactory/api/nuget/nuget-institutional-development-local" protocolVersion="2"/> </packageSources></configuration>



