After configuring a new build pipeline, the build failed with the following error when trying to execute the dotnet restore build task:
NuGet.targets(124,5): error : Unable to load the service index for source http://tfs:8080/DefaultCollection/_packaging/Feed/nuget/v3/index.json
NuGet.targets(124,5): error : No credentials are available in the security package
The strange thing was that the same task worked without a problem on other builds. Only for newly created builds it failed with the error message above.
A workaround that seemed to work was to switch the dotnet build task to the ‘custom’ command. By using the custom command I can add an extra ‘--force’ arguments to the ‘dotnet restore’ command. By adding this extra argument I got rid of the error message above.