Visual Studio 2022 not respecting NuGet.config repositoryPath setting?

Viewed 1193

I am trying to override the default nuget package output location for a C# project (bin/Debug). I have checked the settings in %appdata%/NuGet/NuGet.config, and I see the following:

<add key="repositoryPath" value="C:\Users\david\nuget-packages\" />

This is great, it is exactly where I want NuGet packages placed. Unfortunately, this setting is not being respected by Visual Studio 2022. I have enabled the "Generate NuGet package on build" setting in VS.

I also tried the outdated, accepted answer found here: change output directory of nuget package

Which mentions adding <PackageOutputDir>C:\Users\david\nuget-packages</PackageOutputDir> as a child to PropertyGroup in the relevant .csproj file. Did not work, VS2022 continues to output to the Solutions Debug directory :(

EDIT: Running the command dotnet pack -o C:\Users\david\nuget-packages\ works, but was hoping I would not have to run this command every time I update/build my project...

0 Answers
Related