How do you get Visual Studio to put the output in the Project folder?
20:52 07 Aug 2024

I have a VS 2022 project that has an EXE. When the EXE runs, it wants to open files in the .\data\ and .\saves\ folders.

The problem is that when VS builds the project, it puts the output in myProject\bin\Debug\net8.0; consequently, my EXE can't find .\data\ and .\saves\.

Setting the 'Base Output Path' doesn't help, because it will still append .\Debug\net8.0 to whatever I put in there.

Using a 'Post-build event' doesn't help, because even though my EXE gets copied to the right place, pressing Run from Visual Studio runs the copy in the Debug\net8. directory.

The ugly workaround is to put copies of .\data\ and .\saves\ in each of .\Debug\net8.0 and .\Release\net8.0

Has anyone solved this conundrum?

c# visual-studio-2022