I would like to get the path to the execution directory of a Windows Forms application. (That is, the directory in which the executable is located.)
Does anyone know of a built-in method in .NET to do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Application.Current results in an appdomain http://msdn.microsoft.com/en-us/library/system.appdomain_members.aspx
Also this should give you the location of the assembly
I seem to recall there being multiple ways of getting the location of the application. but this one worked for me in the past atleast (it’s been a while since i’ve done winforms programming :/)