Open petsuter opened 6 years ago
It looks like the help in nuget.exe hasn't been updated since hierarchical config support was added. I'm marking this as up for grabs, it should be an easy fix to improve these strings.
Thanks for posting this issue. I had exactly this problem where Nuget was "writing" to C:\Windows\SysWOW64\config\systemprofile\AppData\Roaming\NuGet\NuGet.config, but this was getting redirected by Windows. Took me hour to figure out what was going on.
Hit this today. My repro:
NuGet version (x.x.x.xxx): 5.4.0.42325
Run nuget config -help
Observe ConfigFile help text that says not specifying a file is supported:
-ConfigFile The NuGet configuration file. If specified, only the settings from this file will be use d. If not specified, the hierarchy of configuration files from the current directory will be used. To learn more about NuGet configuration go to https://docs.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior.
Attempt to use the -configFile flag without a parameter.
nuget config -configfile
Observe an error message:
Missing option value for: '-configfile' NuGet.CommandLine.CommandLineException: Missing option value for: '-configfile' at NuGet.CommandLine.CommandLineParser.ExtractOptions(ICommand command, IEnumerator
1 argsEnumerator) at NuGet.CommandLine.CommandLineParser.ParseCommandLine(IEnumerable
1 commandLineArgs) at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)
NuGet product used: NuGet.exe
NuGet version: 4.5.1.4879
OS version: win10 v1709 (16299.192)
nuget.exe help install
shows:But this help text is very misleading, as by default there are actually multiple
Nuget.Config
files that might be used. This help text does not mention them, nor that these other files are also skipped if the-ConfigFile
option is specified.Is it somehow possible to not skip them? Specifying
-ConfigFile
multiple times does not lead to an error, but the additional files seem to be silently ignored.Is there a way to make nuget print the config files that are used?
nuget.exe sources -Verbosity detailed
does not show any information about that.(This all gets very confusing when NuGet is run on a build server as a Windows Service, where
%AppData%\NuGet\NuGet.config
is actuallyC:\Windows\SysWOW64\config\systemprofile\AppData\Roaming\NuGet\NuGet.config
, but edits to that file are redirected by Windows and hence ignored by Nuget.)