C# – How to find out what directory the console app is running in

.netc++console-application

How do I find out what directory my console app is running in with C#?

Best Solution

To get the directory where the .exe file is:

AppDomain.CurrentDomain.BaseDirectory

To get the current directory:

Environment.CurrentDirectory