I have a console app, and I would like to find the application's path.
In winforms I can use Application.StartupPath
to find the current path, but this doesn't seem to be available in a console app?
I have a console app, and I would like to find the application's path.
In winforms I can use Application.StartupPath
to find the current path, but this doesn't seem to be available in a console app?
System.Reflection.Assembly.GetExecutingAssembly().Location
Combine that with System.IO.Path.GetDirectory
if all you want is the directory.
You looking to do this?
System.IO.Path.GetDirectoryName(
System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)
To get the current executing directory you can use
System.IO.Directory.GetCurrentDirectory()