Gambit King
Gambit King

Reputation: 483

Where to store files in Visual Studio projects

Inside the project folder there is a "project's name" folder, Release and Debug folder. I'm right now working in debug mode and my files keep getting updated everytime i run it, and i copy it into the other 2 folders everytime to avoid confusion. Is this the right way to do it or is it enough if the files are in the main folder ?

Upvotes: 2

Views: 3558

Answers (2)

A_nto2
A_nto2

Reputation: 1096

If your program needs access to text files, images, etc. which are separated from the program's code, you can put these both into the debug or into the release folder. Beware that if you modify these files into the debug folder, you must update the files into the release, and vice-versa. This is valid if you use to switch between the debug mode and the release mode. If you use only the debug mode as I do while I'm developing, you could put all the files in the debug folder only, and copy these files into the release folder only when you will end the development.

Upvotes: -1

Richard
Richard

Reputation: 109140

If you have files in the project that need to be copied to the current output folder on build then select the appropriate options in the file's properties: select the file in solution explorer and then set the properties of that file:

  • Build Action: None
  • Copy to output directory: Copy Always, or Copy If Newer.

Thus VS will put the files in the right place on build. You do not need to maintain multiple copies.

Upvotes: 2

Related Questions