-1

In response to this question I am typing

dotnet publish -r linux-x64

at the command line To my surprise dotnet tries to invoke one of my Azure build pipelines

My screen shows the following

C:\Users\kirst\source\repos\BlazorApp1>dotnet publish --runtime linux-x64 Microsoft (R) Build Engine version 16.8.0+126527ff1 for .NET Copyright (C) Microsoft Corporation. All rights reserved.

Determining projects to restore... C:\Program Files\dotnet\sdk\5.0.101\NuGet.targets(131,5): error : Unable to load the service index for source https://pkgs.dev.azure.com/blahblah/nuget/v3/index.json. [C:\Users\kirst\source\repos\BlazorApp1\BlazorApp1.sln] C:\Program Files\dotnet\sdk\5.0.101\NuGet.targets(131,5): error : Response status code does not indicate success: 401 (Unauthorized). [C:\Users\kirst\source\repos\BlazorApp1\BlazorApp1.sln]

I don't use Azure Devops on this project, but I do for another project, and that pipeline started failing today.

Why is the project trying to call devops?

The Publish profile is set to a folder

publish profile

Kirsten
  • 15,730
  • 41
  • 179
  • 318

1 Answers1

1

The reason for this is that you have defined blahblah as a NuGet package source somewhere, typically in global NuGet configuration (typically %appdata%\NuGet\NuGet.Config). It could also be that there is a NuGet config file somewhere in the parent folder to your project, as NuGet looks recursively for this file until it is found or until the root directory is hit. If the NuGet package source is defined in either of these, it will fail to restore packages as it can't know that the package(s) it seeks are not provided by that feed, thus restore fails.

Krumelur
  • 31,081
  • 7
  • 77
  • 119
  • I tried putting an edited Nuget.Config in the solutions folder but it made no difference. – Kirsten Jan 11 '21 at 22:56
  • 1
    IIRC the local nuget config is merged with the global, but replaces one higher up in the directory hierarchy. – Krumelur Jan 12 '21 at 07:45