_From @felpel on October 9, 2017 3:0_
NuGet.config
accordingly:<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear/>
<add key="MyPrivateFeed" value="https://{myPrivateRepo}.pkgs.visualstudio.com/_packaging/{MyPackages}/nuget/v3/index.json"/>
</packageSources>
</configuration>
dotnet restore
I should be able to restore my private feeds' packages. It works fine in a similar Windows environment.
I'm unable to restore packages from our private VSTS feeds when I call dotnet restore
:
Restoring packages for /Users/Marie-Francoise/Felix/Git/AutoVu.SaaS.Ptms.DataShareService/src/AutoVu.SaaS.Ptms.Dss.Business.Abstractions/AutoVu.SaaS.Ptms.Dss.Business.Abstractions.csproj...
Restoring packages for /Users/Marie-Francoise/Felix/Git/AutoVu.SaaS.Ptms.DataShareService/src/AutoVu.SaaS.Ptms.Dss.Business.Server/AutoVu.SaaS.Ptms.Dss.Business.Server.csproj...
Restoring packages for /Users/Marie-Francoise/Felix/Git/AutoVu.SaaS.Ptms.DataShareService/src/AutoVu.SaaS.Ptms.Dss.AzureFunctions/AutoVu.SaaS.Ptms.Dss.AzureFunctions.csproj...
Restoring packages for /Users/Marie-Francoise/Felix/Git/AutoVu.SaaS.Ptms.DataShareService/src/AutoVu.SaaS.Ptms.Dss.DataLayer/AutoVu.SaaS.Ptms.Dss.DataLayer.csproj...
/usr/local/share/dotnet/sdk/2.0.0/NuGet.targets(102,5): error : Unable to load the service index for source https://autovurnd.pkgs.visualstudio.com/_packaging/AutoVuPackages/nuget/v3/index.json. [/Users/Marie-Francoise/Felix/Git/AutoVu.SaaS.Ptms.DataShareService/AutoVu.SaaS.Ptms.Dss.sln]
/usr/local/share/dotnet/sdk/2.0.0/NuGet.targets(102,5): error : Response status code does not indicate success: 401 (Unauthorized). [/Users/Marie-Francoise/Felix/Git/AutoVu.SaaS.Ptms.DataShareService/AutoVu.SaaS.Ptms.Dss.sln]
dotnet --info
output:
Outils en ligne de commande .NET (2.0.0)
Product Information:
Version: 2.0.0
Commit SHA-1 hash: cdcd1928c9
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.13
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/2.0.0/
Microsoft .NET Core Shared Framework Host
Version : 2.0.0
Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
_Copied from original issue: dotnet/cli#7788_
@felpel how are you providing credentials for this source?
On Windows, I'm able to provide my credentials in a browser popup when the command is called. On Mac, I don't get any popups. I'm unsure if this is related to NuGet or the Git Credential Manager for Mac, where I opened originally the issue.
@felpel you can use a nuget.config file like the following to provide credentials:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="MyFeed" value="https://myPrivateRepo.pkgs.visualstudio.com/_packaging/MyPackages/nuget/v3/index.json" />
</packageSources>
<packageSourceCredentials>
<MyFeed>
<add key="Username" value="myusername" />
<add key="ClearTextPassword" value="mypassword" />
</MyFeed>
</packageSourceCredentials>
</configuration>
I've been able on Windows to restore perfectly my packages within Visual Studio since the authentication is probably built-in, but if I would do it from the terminal, I would get those errors. Since I shouldn't put credentials in a source control file (my NuGet.config
), how would I work this out?
@felpel unfortunately, Plaintext passwords is the only supported method of authenticating NuGet feeds with dotnet cli. Interactive credential acquisition is not enabled. Encrypted passwords support is blocked due to missing ProtectedData.Protect API on CoreCLR.
if you want to use windows, you can use the nuget.exe sources
command to dynamically add the password in an encrypted way to nuget.config file
If I understand correctly, if I don't put credentials in clear it in my config on Mac, I won't be able to ever restore my projects?
unfortunately, yes. I can suggest trying out mono to run nuget.exe on Mac and see if that allows you to add your password in an encrypted way, but i haven't tried that out myself.
It looks like this question has been answered.
This is quite a fundamental blocker for Mac users of .NET Core adopting the VSTS SDLC (or indeed any NuGet-based enterprise SDLC).
Are there plans to address this? Are the dependencies blocking it moving / being nudged?
Any update?
Most helpful comment
This is quite a fundamental blocker for Mac users of .NET Core adopting the VSTS SDLC (or indeed any NuGet-based enterprise SDLC).
Are there plans to address this? Are the dependencies blocking it moving / being nudged?