3

I have a solution with a few projects:

  1. library.dll with something.json
  2. webapp.dll
  3. winapp.exe

2 and 3 depend on 1, not on eachother.

I would like copy something.json to the bin directory of winapp.exe

However setting the properties to Content and Copy always doesn't do what I expected.

enter image description here

online Thomas
  • 8,864
  • 6
  • 44
  • 85

2 Answers2

3

You can use the Post-build event command line of your winapp.exe for instruct to copy that file inside your target dir

something like this

xcopy /Y  $your path of something.json $(TargetDir).

Change your path of something.json to your actual path.

Remember that you have a set of usefull link

  • (TargetDir) = Where your project is going to be compiled
  • (SolutionDir) = The solution path on your disk
  • (ProjectDir) = The project path on your disk
Stefano Cavion
  • 641
  • 8
  • 16
  • @AliasgharAhmadpour remember that this is not a competition, any contribution is welcome ;) this answer gives a bit more explanations than yours, and since it has been accepted, he was right to write it. – limserhane May 25 '22 at 12:26
  • Ok @limserhane. You are right. but this is not my mean. So i'v deleted my comment – Aliasghar Ahmadpour May 25 '22 at 12:33
2

You can use Build events.

Go to "Project properties -> Build events -> Post build events command line:"

And use command to copy any file

Read more about Build events on Build events