Migrating to my Linux machine for work I have run into a problem with Nuget. Our projects are .net core 3.1 and each has its own nuget.config file which has four package sources in it. The first is the obvious one but the rest are specific for the company.
Whenever I build I get an error stating that I am not authorised:
/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)
but I can get the json output when I put that in a browser. I have run:
mozroots --import --sync --url https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt
as the thread I found it on seemed to having a similar issue but for me no luck.
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
The build is definitely hitting the correct nuget.config and is not using my local use config. How can I fix this issue?
I have all packages from key="nuget.org" value="https://api.nuget.org/v3/index.json" downloaded as it is the first in the list I think.