-1

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?

Havyia Ayv
  • 73
  • 2
  • 5

1 Answers1

-1

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)"

enter image description here

Click on edit to view macros, or refer to documentation.

enter image description here

If you want to use it in .net.

xcopy /y /e "$(Targetdir)*.exe" "$(SolutionDir)"
Jiale Xue - MSFT
  • 3,560
  • 1
  • 6
  • 21