当我迁移到我的Linux机器上工作时,我遇到了Nuget的问题。我们的项目是.net core 3.1,并且每个项目都有自己的nuget.config文件,其中包含四个软件包源。第一个是显而易见的,但其余的是特定于公司的。
每次构建时,我都会收到未经授权的错误提示:
/usr/share/dotnet/sdk/3.1.301/NuGet.targets(128,5): error : Unable to load the service index for source https://aldinternational.pkgs.visualstudio.com/_packaging/PLASMA/nuget/v3/index.json. [/home/lg/Documents/ALD/repo/CampaignIngestion.OmegaConnector/OmegaConnector.Functions/OmegaConnector.Functions.csproj] /usr/share/dotnet/sdk/3.1.301/NuGet.targets(128,5): error : Response status code does not indicate success: 401 (Unauthorized). [/home/lg/Documents/ALD/repo/CampaignIngestion.OmegaConnector/OmegaConnector.Functions/OmegaConnector.Functions.csproj] 0 Warning(s) 1 Error(s)
但是当我在浏览器中输入时,可以获得JSON输出。 我已经运行了以下命令:
构建明确地使用正确的 nuget.config 文件,而不是使用我的本地配置文件。我该如何解决这个问题?
我认为我已经从 key="nuget.org" value="https://api.nuget.org/v3/index.json" 下载了所有的包,因为它是列表中的第一个。
每次构建时,我都会收到未经授权的错误提示:
/usr/share/dotnet/sdk/3.1.301/NuGet.targets(128,5): error : Unable to load the service index for source https://aldinternational.pkgs.visualstudio.com/_packaging/PLASMA/nuget/v3/index.json. [/home/lg/Documents/ALD/repo/CampaignIngestion.OmegaConnector/OmegaConnector.Functions/OmegaConnector.Functions.csproj] /usr/share/dotnet/sdk/3.1.301/NuGet.targets(128,5): error : Response status code does not indicate success: 401 (Unauthorized). [/home/lg/Documents/ALD/repo/CampaignIngestion.OmegaConnector/OmegaConnector.Functions/OmegaConnector.Functions.csproj] 0 Warning(s) 1 Error(s)
但是当我在浏览器中输入时,可以获得JSON输出。 我已经运行了以下命令:
mozroots --import --sync --url https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt
我发现这个线程似乎有类似的问题,但对于我来说没有用。dotnet --info output
.NET Core SDK (reflecting any global.json):
Version: 3.1.301
Commit: 7feb845744
Runtime Environment:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-x64
Base Path: /usr/share/dotnet/sdk/3.1.301/
Host (useful for support):
Version: 3.1.5
Commit: 65cd789777
.NET Core SDKs installed:
2.1.302 [/usr/share/dotnet/sdk]
2.2.300 [/usr/share/dotnet/sdk]
3.1.301 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
构建明确地使用正确的 nuget.config 文件,而不是使用我的本地配置文件。我该如何解决这个问题?
我认为我已经从 key="nuget.org" value="https://api.nuget.org/v3/index.json" 下载了所有的包,因为它是列表中的第一个。