How To Get The Exe Directory For The Current Console Application In C#



TODO:

Have you ever wanted to get the directory for the executing Console Application in C#?  The following method will do so, and is the equivalent of Application.StartupPath when working with Windows Forms.

 

SOLUTION:

 

System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)

 

NOTES:

There are no notes on this topic.



Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading