Book a Demo

Author Topic: Using EA in ASP.NET Core 2.1  (Read 6539 times)

Slávek Rydval

  • EA User
  • **
  • Posts: 40
  • Karma: +2/-0
    • View Profile
    • homepage
Using EA in ASP.NET Core 2.1
« on: December 17, 2018, 09:37:19 am »
I want to create ASP.NET Core 2.1 application with reading data from EA (I know that joining .NET Core with the Win32 world is not recommended). I create a web application from the template in Visual Studio 2017, add a reference to Interop.EA and in a controller is this code:

Code: [Select]
public IActionResult Index()
{
    EA.Repository r = new EA.Repository();
    r.OpenFile(@"c:\Temp\UCI.EAP");

    return View();
}

When creating a new instance, it fails with System.ExecutionEngineException exception (in data of the exception is {System.Collections.EmptyReadOnlyDictionaryInternal}). Do you have any idea how to fix it?

An instance of EA is in processes created.
« Last Edit: December 17, 2018, 09:39:24 am by Slávek Rydval »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Using EA in ASP.NET Core 2.1
« Reply #1 on: December 17, 2018, 09:56:15 am »
I don't have a solution to your problem, but want to point out that using the EA API from an ASP application would require a license of EA for each end user of that application. (To conform with the license agreement. See section 6)

Slávek Rydval

  • EA User
  • **
  • Posts: 40
  • Karma: +2/-0
    • View Profile
    • homepage
Re: Using EA in ASP.NET Core 2.1
« Reply #2 on: December 17, 2018, 10:13:14 pm »
Simon, cheers for the message, I know it. Fortunately, we've got enough licences.

Slávek Rydval

  • EA User
  • **
  • Posts: 40
  • Karma: +2/-0
    • View Profile
    • homepage
Re: Using EA in ASP.NET Core 2.1
« Reply #3 on: December 18, 2018, 08:27:14 am »
To be more specific after a couple of hours spent with it:
  • the exception is thrown on .NET Core 2.0, 2.1 and 2.2
  • on NET Core 3.0 Preview 1 it is working correctly.
The thing is that 3.0 is still a preview, so the solution is still missing.

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Using EA in ASP.NET Core 2.1
« Reply #4 on: December 18, 2018, 10:42:04 am »
Sounds like you are trying to expose some Sparx EA things via a web interface.
Do you know there is a product called WebEA and Cloud Pro Server that does this?
Using Sparx EA application on a web server doesn't sound like a good idea by the way.
Happy to help
:)

Slávek Rydval

  • EA User
  • **
  • Posts: 40
  • Karma: +2/-0
    • View Profile
    • homepage
Re: Using EA in ASP.NET Core 2.1
« Reply #5 on: December 19, 2018, 01:07:35 am »
Yes, I know it. WebEA doesn't solve my needs no matter what they are.