Skip to content

dotnet restore fails with auth'd (VSTS) package source #8708

@Mardoxx

Description

@Mardoxx

Steps to reproduce

  1. Create new project and target netstandard (e.g. netcoreapp2.0, netstandard2.0)
  2. Nuget.Config with custom package source e.g.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="NuGet" value="https://api.nuget.org/v3/index.json" />
    <add key="Common" value="https://mysource.pkgs.visualstudio.com/_packaging/Common/nuget/v3/index.json" />
  </packageSources>
</configuration>
  1. dotnet restore
  2. Restore fails

Expected behavior

:)

Actual behavior

:(

C:\Program Files\dotnet\sdk\2.1.0-preview1-006784\NuGet.targets(102,5): error : Failed to retrieve information about 'Microsoft.NETCore.App' from remote source 'https://mysource.pkgs.visualstudio.com/_packaging/3df2ef6b-68fa-412c-90fa-bcee06e30045/nuget/v3/flat2/microsoft.netcore.app/index.json'. [.csproj]
C:\Program Files\dotnet\sdk\2.1.0-preview1-006784\NuGet.targets(102,5): error :   Response status code does not indicate success: 401 (Unauthorized). [.csproj]

Restore packages works fine in VS2017.

Completely buggers up any dotnet ef commands too as these rely on the project building successfully!

Environment data

dotnet --info output:

.NET Command Line Tools (2.1.0-preview1-006784)

Product Information:
 Version:            2.1.0-preview1-006784
 Commit SHA-1 hash:  0b507e68fd

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.15063
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.1.0-preview1-006784\


Microsoft .NET Core Shared Framework Host



  Version  : 2.0.0

  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

Happens with net461 tfm too, so not really sure what the problem is here..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions