Skip to content

dotnet tool install from azure devops failed #10092

@Zeroks77

Description

@Zeroks77

Steps to reproduce

1. Ensure .NET SDK 2.2.103 is installed
2. ```dotnet tool install --add-source "https://pkgs.dev.azure.com/account/_packaging/feedname/nuget/v3/index.json" --global ACConfigbuilder```

Expected behavior

Tool "acconfigbuilder" (Version 1.1.0) was successfully installed.

Actual behavior

C:\Program Files\dotnet\sdk\2.2.103\NuGet.targets(114,5): error : Failed to retrieve information about 'acconfigbuilder' from remote source 'https://pkgs.dev.azure.com/dominikmangatter/_packaging/artifact_ACB/nuget/v3/index.json'. [C:\Users\Tester\AppData\Local\Temp\h2vj5tjo.mmy\restore.csproj]
C:\Program Files\dotnet\sdk\2.2.103\NuGet.targets(114,5): error : Response status code does not indicate success: 401 (Unauthorized). [C:\Users\Tester\AppData\Local\Temp\h2vj5tjo.mmy\restore.csproj]

The tool package could not be restored.

Environment data

dotnet --infooutput:

.NET Core SDK (reflecting any global.json):
Version: 2.2.103
Commit: 8edbc25

Environment:
OS Name: Windows
OS Version: 10.0.17763
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.2.103\

Host (useful for support):
Version: 2.2.1
Commit: 878dd11e62

.NET Core SDKs installed:
2.2.103 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download

Notes

Here is the sample NuGet.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
 <packageSources>
    <!--To inherit the global NuGet package sources remove the <clear/> line below -->
    <clear />
    <add key="MyFeed" value="https://pkgs.dev.azure.com/dominikmangatter/_packaging/artifact_ACB/nuget/v3/index.json" />
    <add key="nuget" value="https://api.nuget.org/v3/index.json" />    
 </packageSources>
</configuration>

The command dotnet restore --interactive also had no effect and led to the same error.
Note that if you try to use the CredentialProvider.VSS the --interactive option is not available.

My workaround

  1. create a dummy project with dotnet new console.
  2. create a nuget.config with dotnet new nugetconfig.
  3. now add your own feed to your nuget in the nuget.config.
  4. now you can perform dotnet restore --interactive and authenticate yourself.
  5. your nuget should now be configured.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions