Do not mix up two completely different directories: working directory (this is the one you found) and executable directory. Working directory is good for simple applications, but it does not depend on where your executable files are, it totally depends on where the users starts the application, and the user can start if from any directory.
In contrast, executable directory has certain location depending where your executable files are. There are several different ways to find it, but some of them are not reliable in that sense that the results depend on how the application is hosted. In particular, running the application under Windows Studio or Service Controller (for Windows Service applications) cause problems. This is the most certain method to find this directory:
string exeDirectory =
System.IO.Path.GetDirectoryName(
System.Reflection.Assembly.GetEntryAssembly().Location);
This method also does not depend on the assembly running this code, if finds location of the entry assembly of the currently running application (.EXE file), more exactly, location of its main executable module.
—SA