0

i have created a small addin for excel, but for configuration purposes, i need to determine where the user has installed the add-in, the specific location of the exe. How can i do this in C#??

adiagya
  • 31
  • 3

1 Answers1

1

Application.ExecutablePath should do the trick.

Niels Keurentjes
  • 41,402
  • 9
  • 98
  • 136
  • i tried that and i tried this Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ..the latter seems to work for me...thanks anyways – adiagya Apr 13 '13 at 10:19
  • In the case of an assembly that gets loaded in another process context it's more correct anyway. – Niels Keurentjes Apr 13 '13 at 10:38