Book a Demo

Author Topic: Get file path of the running .eapx file  (Read 3962 times)

ankur

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Get file path of the running .eapx file
« on: April 24, 2019, 10:56:59 pm »
Hello,

I would like to get the complete directory path in EA Add-in along with the filename for the current .eapx file that I have opened.

I have tried the following in C# code for the Add-in:

Console.WriteLine(System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
Console.WriteLine(System.AppDomain.CurrentDomain.BaseDirectory);
Console.WriteLine(System.Environment.CurrentDirectory);
Console.WriteLine(System.IO.Directory.GetCurrentDirectory());
Console.WriteLine(Environment.CurrentDirectory);

But all of them return me the path of EA.exe and not my abc.eapx file.

Can anyone guide me in this regard.

Thanks in advance.

Regards,
Ankur

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Get file path of the running .eapx file
« Reply #1 on: April 24, 2019, 11:18:32 pm »
Hi Ankur,

Try Repository.ConnectionString
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


ankur

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Re: Get file path of the running .eapx file
« Reply #2 on: April 24, 2019, 11:31:25 pm »
Hi Ankur,

Try Repository.ConnectionString

It worked. Thanks Guillaume :)