Take the 2-minute tour ×

I am developing a desktop application, running it every once in a while, from Visual Studio, to see if already-implemented features are working. There is no testing code so far.

My doubt is: When I run the program, it produces some output files which are indended to be written to a given directory structure in the client (using the installed/deployed application, that is).

So, how do I:

  • Define a directory structure similar to the one that is to be used with the deployed application;
  • Point to that same folder while debugging, regardless of which project of the solution I choose as "Startup".

I expect some form of "good practices" advice regarding "application directory management" while developing in Visual Studio.

Thanks for reading!

share|improve this question
add comment

1 Answer

Hard to say exactly given the amount of detail you've provided, but surely the deployed application, will be at least have a configuration to the root folder of the directory structure it's going to use.

Also surely it's going to cope with sub-directories not existing, or some 'fool' of a user deleting them..

All depends on how configurable you need it to be, but at it's simplest, a default to say MyDocuments, or some folder under appdata , if nothing there.Otherwise the root folder of the directory structure out of app.config. Add some robustness by forcing the creation of folders if they don't exist.

If it were me I'd go one step further and have class to manage the file system with a suitable interface, then I could inject one for unit testing with whatever properties seemed useful / relevant.

PS no testing code so far, usually equals no testable code and therefore no testing code ever, bad move that...

share|improve this answer
The app.config part rang a bell. Gonna take a look. Thanks so far! –  heltonbiker Oct 8 '13 at 21:52
add comment

Your Answer


