Copying Files During Build

I have text files that my program should download. The program will search for these files in the executable directory. These files are currently located in the project directory (and are part of the project).
Is there any way to tell visual studio to place these files in the bin / debug (or bin / release) directory as part of the build process?

+3
source share
3 answers

Try using build events

You can use the $ (TargetDir) macro, which will go to bin / release or bin / debug depending on what you are doing. Macro List Competing Here

eg Copy "$(ProjectDir)*.txt" "$(TargetDir)"

txt

+2

, - .

, CMD-, :

  • ( "" ).
  • Build Action Content.
  • " " " " "", "".

Visual Studio , , .

+7

Of course. Use the post-build event configured in the project properties window.

+1
source

Source: https://habr.com/ru/post/1785495/


All Articles