views:

395

answers:

3

I've got a simple console project where I'm reading two Excel-files. The Excel-files are included in the project ("add existing item") and I've marked them with "Copy to Output Directory". However, they are not copied to the debug-directory when debugging/running the code.

I feel like I've forgotten something trivial. What do I need to do more?

+1  A: 

Silly question but are you running in debug mode? I've made the same mistake and realised I was in release mode.

Ray Booysen
Good question, but no, I am running in debug mode.
Jonas Lincoln
+1  A: 

Did you mark them as content?

bh213
No, but I have now, and it didn't make a difference.
Jonas Lincoln
+1  A: 

Changes to non-source code files don't cause a rebuild to occur - they aren't considered when the compiler does it's out of date checking.

Try forcing a complete rebuild by deleting your output directory completely (sometimes doing this from within Visual Studio isn't complete).

It may be that the files haven't been copied across because a full build hasn't been run.

Bevan
Yep, that was it. So simple...
Jonas Lincoln