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:
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
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:
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
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.