Working Directory in Visual Studio C# file

user358591 picture user358591 · Sep 9, 2010 · Viewed 17.2k times · Source

What exactly is Working Directory in the properties of Visual Studio C# project.

I have see a project where I right click and go to Properties and then I go to Debug tab, it shows me Working Directory where Author of the code has specified folder in local machine. I want to know what does that working directory means and what kinds of file will it store in that directory.

Thank you in advance.

Answer

Brian R. Bondy picture Brian R. Bondy · Sep 9, 2010

Every process has a current Working Directory which is where all relative paths will be formed from. If not specified, this directory is the directory in which the active application started.

You can check which directory is set by calling:

System.IO.Directory.GetCurrentDirectory();

As mentioned above in a comment by @0xA3 this setting has no effect to your deployed product, it is is only for debugging.