When using msbuild to restore packages for a project / solution, how can we explicitly specify a NuGet.config file to use?
Old
> nuget.exe restore -configFile <path to NuGet.config> Roslyn.sln
New, unsure how to specify NuGet.config explicitly.
> msbuild /t:Restore Roslyn.sln
I looked through this page but didn't see an answer
https://docs.microsoft.com/en-us/nuget/consume-packages/package-restore
You can pass it with: /p:RestoreConfigFile=<path>
It looks like the docs need to be updated on this.
For reference the set of properties are here:
https://github.com/NuGet/NuGet.Client/blob/68245312b050c5b992120448353eba3e20cdc414/src/NuGet.Core/NuGet.Build.Tasks/NuGet.targets#L100-L106
Thanks! Will leave this open in case you want to use it to track the documentation change.
@karann-msft can we get the docs updated for this? Or possibly I'm just not finding them.
I did get this updated, see https://docs.microsoft.com/en-us/nuget/schema/msbuild-targets#restore-target.
Most helpful comment
You can pass it with:
/p:RestoreConfigFile=<path>It looks like the docs need to be updated on this.
For reference the set of properties are here:
https://github.com/NuGet/NuGet.Client/blob/68245312b050c5b992120448353eba3e20cdc414/src/NuGet.Core/NuGet.Build.Tasks/NuGet.targets#L100-L106