I have a console application and when I run it, an exe file is generated in Bin/Debug folder.
How can I change the path of exe generated to parent folder where src resides?
I have a console application and when I run it, an exe file is generated in Bin/Debug folder.
How can I change the path of exe generated to parent folder where src resides?
I created a c# console .Net Framework 4.8 project, there are two ways to achieve your needs.
The first way you can directly change the way the exe is generated in the properties, and the second way you can use the post-build method to copy the exe to src.
The first:
Modify in project->properties->build->output, for example, modify to ..
The Debug folder will be generated to the upper layer.
The second: copy only the exe.
xcopy /y /e "$(TargetPath)" "$(SolutionDir)"
Click on edit to view macros, or refer to documentation.
If you want to use it in .net.
xcopy /y /e "$(Targetdir)*.exe" "$(SolutionDir)"