Should I use AppDomain.CurrentDomain.BaseDirectory or System.Environment.CurrentDirectory?

If you want to find files in the same directory as your application, AppDomain.CurrentDomain.BaseDirectory is the correct choice.

Environment.CurrentDirectory is a value that can and will change throught the course of running your application. For instance, using default parameters, the OpenFileDialog in WinForms will change this value to the directory where the file was selected from.

Leave a Comment