Search code examples
c#visual-studio-2010debuggingsetup-project

Copy "Filesystem on Target Machine" to bin/Debug and bin/Release


I did a lot of googling, but didn't find any answer for this problem so far...

I defined the File System on the Target Machine for my program in Visual Studio 2010. It includes all of the external Files (like XML's and batch files) which are needed to run the program. The files are stored in the Program Files folder.

The thing is now that if I try to debug my program, it says that it can't find the needed files in MyTool/MyStartProject/bin/Debug.

Is there any way to tell visual studio that it must copy these files to the Debug and Release folder to run the program?

I don't want to copy all files to the bin folder every time I want to run my program.

Thanks for any hint!

EDIT:

This is how my 'File System on Target Machine' looks like:

File System on Target Machine

I created it using the built-in editor and Drag&Drop of the files and folders I need.


Solution

  • Add the needed files to your project, and for each file, open File Properties pane, select "Copy always" in the Copy to Output directory property.

    Copy to Output Directory