I have a project that's building fine locally but the build in VSTS it fails in dotnet build
command. The error looks very strange to me because I have no idea why a build command would try to restore packages again. Here's what the error looks like:
2018-07-09T11:06:48.2541705Z Retrying 'FindPackagesByIdAsync' for source 'https://mycompany.pkgs.visualstudio.com/_packaging/5b9fd539-d653-4771-aa3c-6544d73b1234/nuget/v3/flat2/system.data.sqlclient/index.json'. 2018-07-09T11:06:48.2562315Z Response status code does not indicate success: 401 (Unauthorized).
Prior to build step, I have a dotnet restore step which is completed successfully. Restore step uses a NuGet.config file which includes private feeds in VSTS but the URLs do not look similar to the one in the error. Here's the file just to make it clear.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="MyCompany.NuGet.Internal" value="https://MyCompany.pkgs.visualstudio.com/_packaging/MyCompany.NuGet.Internal/nuget/v3/index.json" />
<add key="MyCompany.NuGet.ThirdParty" value="https://MyCompany.pkgs.visualstudio.com/_packaging/MyCompany.Nuget.ThirdParty/nuget/v3/index.json" />
</packageSources>
</configuration>
What could be the problem here? Is dotnet build step ignoring the NuGet.config file completely and trying the feeds in the project? I have no idea how that feed URL is generated.