Clash between development and production config files #13380
Labels
Area:Authentication
Area:Settings
NuGet.Config and related issues
Functionality:Restore
Priority:3
Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog.
Type:Docs
Originally posted on StackOverflow, and in discussions page here on repo, without success. I can't believe I'm the only one with this issue. How is this typically done? Can someone please point me to an example or official docs that deal with this?
Discussed in #12824
Originally posted by lonix1 August 18, 2023
Originally posted on StackOverflow without success. Any help would be appreciated.
My .net project is built locally by me during development, and remotely by my ci/cd server.
The project has project-level config in
myproject/nuget.config
. It is used by my ci/cd server, which provides some environment variables:My local machine has user-level config in
~/.nuget/Nuget/Nuget.Config
, which is the same, except for different credentials:That works in the ci/cd server, i.e. in production.
But locally (i.e. in development), I get 401/Unauthorized errors when running
dotnet restore
(etc.) - because the project-level config (which requires extra env vars) overwrites the user-level config. (I have many other repos with the same issue, so I don't want to export env vars or add stuff to my .bashrc: it's messy, I don't want to do that.)This seems to be the opposite to how it's typically done, where there is some "default" checked into source control, and it can be customised during development (with overriding config files) and production (with config files or env vars).
How do I do this?
The text was updated successfully, but these errors were encountered: