NuGet product used: NuGet.exe
NuGet version (x.x.x.xxx): 5.0.2.5988
OS version (i.e. win10 v1607 (14393.321)): win10 v1709 (16299.1146)
Worked before? If so, with which NuGet version:
Hasn't worked since at least 4.9.3. Not sure prior to that.
NuGet CLI config command documentation states that you can remove a key from the config file by using nuget config -set <name>= with no value after the =. However, this seems to have no affect on the config file.
Example:
nuget config -set dependencyVersion="Highest"
New dependencyVersion key will be added to nuget.config:
<config>
<add key="dependencyVersion" value="Highest" />
</config>
Now try to remove the key:
nuget config -set dependencyVersion=
nuget.config file is unchanged, dependencyVersion key and value are still present:
<config>
<add key="dependencyVersion" value="Highest" />
</config>
Also tried:
nuget config -set dependencyVersion=""
which has no affect.
nuget config -set dependencyVersion=" "
This will replace the value with a space (" "), but the key is still present in the file.
Please include verbose logs (NuGet.exe
No info in the verbose log other than version:
nuget config -set dependencyVersion= -verbosity detailed
NuGet Version: 5.0.2.5988
Very helpful if you can zip a project and paste into this issue!
Was able to repro in mentioned versions and also NuGet Version: 4.4.3.5892.
Any updates? 5.3.0 is still affected.
Still the same with nuget version 5.3.1.6268...
I had the same issue. For now I use the following workaround:
It seems the deletion does work when you add a second 'set' command.
f.e: "nuget.exe config -Set repositoryPath= -set signatureValidationMode=accept"
does delete the repositoryPath-setting, where "nuget.exe config -Set repositoryPath=" would not.
Note: i use "signatureValidationMode=accept" just because this is the default value so it does not really change anything.
@kennydv Perfect your workaround work perfectly 馃 馃槃
Thank you !
Guys, please up-vote the original post in this thread, so it gains more visibility. Maybe they'll fix it sooner this way.
@kennydv: Thanks for the workaround!
Just encountered this issue too. I'm using version 5.5.1.6542. No good way to unset the config. Vote for such feature.
This is still a problem in NuGet Version: 5.7.0.6726
/cc @dominoFire
Most helpful comment
I had the same issue. For now I use the following workaround:
It seems the deletion does work when you add a second 'set' command.
f.e: "nuget.exe config -Set repositoryPath= -set signatureValidationMode=accept"
does delete the repositoryPath-setting, where "nuget.exe config -Set repositoryPath=" would not.
Note: i use "signatureValidationMode=accept" just because this is the default value so it does not really change anything.