views:

119

answers:

1

I have a C# Console app in VS C# Express 2008. The program needs to read a few files at runtime, which I would like to place in the same directory as the .EXE for convenience. But of course there are two .EXEs, one debug and one release, and I don't want to copies of everything. What's the best way to manage this?

+3  A: 

You could just change the output path of both configurations to use just 'bin\'.

-- or --

You could add the files to the project, right-click, and set "Copy to Output Directory" to "Always"

csharptest.net
you want to go with option 2 btw, having separate Debug / Release directories is very useful.
Kragen
Well, doing the "Copy to Output Directory" almost solved my problem. I don't want the root folder of my project cluttered with hundreds of .GIF images, for example, so I had them in a folder of their own--let's call it GIFS. I added the .GIF files to the project and set set "Copy to Output Directory" to "Always". However, the copying process created the directory GIFS in the debug and release areas. This is not really what I wanted either. Any way to not have all these files at the top of the project and have them found during runtime without hard-coding some path?
I. J. Kennedy