0

I have created a C# add-in in VS2015 to import and synchronise data models from Power Designer into Enterprise Architect. It has dependencies for PDPDM, PDLDM, PDCDM, and Interop.EA.

The problem is that it crashes when I deploy and then run it on a Windows 7 Machine.

To install the add-in I do the following:

  1. Register the add-in dll in the COM codebase entries in the registry using regasm.exe By opening up a command prompt in folder where you copied the add-in dll and register the dll with the /codebase option. In my case that command would be: %WINDIR%\Microsoft.NET\Framework\v4.0.30319 .\RegAsm.exe -tlb -codebase

  2. Add the registry key: Add a key to HKEY_CURRENT_USER\Software\Sparx Systems\EAAddins in the form of [ProjectName].[ClassName]

This installation works fine on both the development and deployed machines and I am able to run the add-in. The add-in works completely fine when installed on the development machine.


However on the deployed Windows 7 machine it crashes in one specific case:

  • When running an import for a physical data model the add-in starts working (starts to extract Power Designer information) and then crashes unexpectedly with only the message that it Enterprise Architect has "stopped working". In the event log the information points to the .NET clr.

This is unexpected as the add-in was registered with the same version of .NET in both cases.


I have investigated source code and compared it to a working dll made using the same libraries and found no differences. I am sure it is to do with the deployment environment on the Windows 7 machine.

Any ideas on why the add-in might be crashing on the Windows 7 machine?

And any suggested fixes?

UPDATE: I have tried narrowing down and commenting out aspects of the code to make it work on the Windows 7 machine. No matter what I comment out as it starts reading any part of the Physical Model from power designer it crashes, this is not the case for all other data models (logical and conceptual).

Given the way it is behaving I am looking further into the environment and deployment.

Any help is still much appreciated...

UPDATE 2: Thank you for the help from everyone. I have used the advice and was able to eventually track down the error:

The process was terminated due to an internal error in the .NET Runtime at IP... with exit code 80131506.

I am pursuing this error code and errors with the environment/garbage collector

  • Can it be a security issue? have you tried running it on W7 with admin rights - if possibile? – Frank Nielsen Jan 14 '20 at 21:39
  • All the of the installation steps are run with admin rights. The dll is not run with admin rights but does not need them (it runs fine without admin rights on my machine) – jack orchard Jan 14 '20 at 21:42
  • But always try it, at least just to exclude the issue. Never assume anything when doing bug/error investigation ;) – Frank Nielsen Jan 14 '20 at 21:48
  • What about versions of EA, are they the same on the dev and W7 machines? – Frank Nielsen Jan 14 '20 at 21:49
  • Thanks for the idea will give it a go. The EA and Power Designer versions are the same on the machines and the same data models are being used. – jack orchard Jan 14 '20 at 21:51
  • I would also try running filemon.exe, from sysinternals. To see for any required file that are missing - you never know. – Frank Nielsen Jan 14 '20 at 22:07
  • EA often behaves "silly" when you start doing certain things. I'm pretty sure Geert will chip in and come up with a good idea. My only advice is: lower down the issue by reducing functionality until the issue starts to turn off (and back again). – qwerty_so Jan 14 '20 at 22:13
  • One of the problems is that EA crashes when it encounters an exception in an add-in. What you can do is build a catch-all exception handler. This might work for most exceptions (but others such as StackOverflow exception cannot be caught). It this case it seems that the actual problem is in the powerdesigner part and not due to any weird EA behavior. – Geert Bellekens Jan 15 '20 at 11:49

1 Answers1

1

The problem was as Geert suspected, with Power Designer. The Power Designer type libraries used were different between machines with one patch to Power Designer upgrading the PdPDM type library to a new version. This changed the way Physical Data Models interacted with the add-in when using the PdPDM type library.

It may be helpful to note that creating and using a dump file when an enterprise architect add-in crashes was very helpful and pointed me to lines of code that could isolate the problem.