You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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?
Beta Was this translation helpful? Give feedback.
All reactions