-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support for envvars in NuGet.config - improve docs for xplat behavior #8662
Comments
@anangaur sorry for the long delay, but here's the issue I promised to file. |
Looks like I evolved the title badly. We do support envvars in nuget.config, and it should work on mac/linux too. |
This works fine with dotnet.exe 3.0 on windows:
|
@infin8x - can you try %NUGET_AUTH_TOKEN% instead of $NUGET_AUTH_TOKEN. |
No dice, that also fails, even after I install netcore 3.0. Simplest repro of this:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
<packageSourceCredentials>
<GPR>
<add key="username" value="infin8x" />
<add key="cleartextpassword" value="%NUGET_AUTH_TOKEN%" />
</GPR>
</packageSourceCredentials>
</configuration> |
But, I agree that this works on Windows, I think this is a Mac(/Linux)-only issue. |
Looks like %foo% works fine on dotnet.exe 3.0 on linux (ubuntu 18.4) My guess is that this is GPR implementation related. |
@infin8x - see my last comment. |
work remaining here is to make sure we improve our docs. |
Sorry for the delay here, I think someone from the GPR team is digging in more to what's going on here. But, glad to know the envvar works. Looking forward to the docs improvement. |
there is a modified section about env vars in config files here: https://docs.microsoft.com/en-us/nuget/reference/nuget-config-file#using-environment-variables also https://docs.microsoft.com/en-us/nuget/reference/nuget-config-file#packagesourcecredentials has been updated with a sample. |
Details about Problem
NuGet product used: dotnet on Mac
dotnet.exe --version (if appropriate): 2.2.104
OS version (i.e. win10 v1607 (14393.321)): macOS Mojave 10.14.6
Worked before? If so, with which NuGet version: [Was No, @rrelyea added comment with link to docs. Perhaps this is a dotnet.exe bug only?]
Detailed repro steps so we can see the same problem
Set up NuGet.configs and add a valid token to your environment like so:
Attempt to run
dotnet restore
:Move token to file directly (to prove that it's a valid token and not a server-side issue):
Note: I know there is a token in these screenshots. I revoked it before publishing.
Other suggested things
Verbose Logs
log.txt
Sample Project
You can git clone https://github.com/infin8x/starter-packages and use the
nuget-bacon
package.The text was updated successfully, but these errors were encountered: