1
Automation Interface, Add-Ins and Tools / Problem Accessing Current EA instance from C# with EA 12
« on: May 31, 2016, 10:36:48 pm »
I need to access the running instance of EA from C#,
I have two machines one with EA version 10 installed and the other has version 12
The following code snippet works fine and returns the correct connection string with EA Version 10
but with EA version 12 ConnectionString is empty and it throws an exception that a file must be open before accessing the repository members.
I have two machines one with EA version 10 installed and the other has version 12
The following code snippet works fine and returns the correct connection string with EA Version 10
Code: [Select]
EA.App EAApplication = (EA.App)Marshal.GetActiveObject("EA.App");
string connStr = EAApplication.Repository.ConnectionString;
Collection models = EAApplication.Repository.Models;
but with EA version 12 ConnectionString is empty and it throws an exception that a file must be open before accessing the repository members.