Author Topic: Making Add-Ins COM-visible  (Read 5579 times)

Raya

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Making Add-Ins COM-visible
« on: December 03, 2018, 07:08:31 pm »
Hello Everybody,

I tried to write a small C# Add-In near to the discription on https://bellekens.com/2011/01/29/tutorial-create-your-first-c-enterprise-architect-addin-in-10-minutes/.
For the new project I chose a .NET Standard Class Library and referenced the Interop.EA.dll as described. Then I appended the code and added the registry key.
The problem I had following the instrunctions were making the assembly COM-visible and Register for COM interop. I read that the Assembly Informations in Visual Studio 2017 can be found in the "Application" tab, but in my case the
"Assembly Information" button was missing. Furthermore the Checkbox "Make assembly COM-visible" is greyed out.
To solve this problem I added in the C#-sharp code " [ComVisible(true)]" to the class and " [ComRegisterFunctionAttribute]" but the Add-In doesn't work. In the EA "Manage Add-Ins" my Add-In has the Status "Error Missing".
Perhaps it was the wrong way choosing a .NET Standard Class Library, I'm really new in .NET developments.

For backround information: I'm using Visual Studio Community 2017, EA 14 on a Windows 10 system.

Thanks for help!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 10416
  • Karma: +343/-30
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Making Add-Ins COM-visible
« Reply #1 on: December 03, 2018, 07:45:04 pm »
Hi Raya

You might want to download my example add-in  from github to figure out what is different in your case.

From what you describe you are doing the right things, so the assembly information tab should be there.

I'm using exactly the same configuration as you, so that is certainly not the problem.

Geert

Raya

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Making Add-Ins COM-visible
« Reply #2 on: December 03, 2018, 08:28:37 pm »
Hi Geert,

I compared my solution with yours and the problem seems to be that I chose the project as .NET Standard instead of .NET Framwork Class Library.
Now the Add-In works as expected.
Thanks for help!

Raya

michielper

  • EA User
  • **
  • Posts: 149
  • Karma: +2/-1
    • View Profile
Re: Making Add-Ins COM-visible
« Reply #3 on: May 16, 2020, 08:56:25 pm »
Hi Geert,

I compared my solution with yours and the problem seems to be that I chose the project as .NET Standard instead of .NET Framwork Class Library.
Now the Add-In works as expected.
Thanks for help!

Raya

I have the same problem and cannot find where to choose the project type in "Blend for Visual Studio".....

Sunshine

  • EA User
  • **
  • Posts: 952
  • Karma: +83/-7
  • Its the results that count
    • View Profile
Re: Making Add-Ins COM-visible
« Reply #4 on: May 19, 2020, 06:37:05 am »
Its confusing when they all have visual studio in the name isn't it.
The reason is that the instructions are for Visual Studio. Try Visual studio or Visual Studio Code (free version). 
« Last Edit: May 19, 2020, 06:50:01 am by Sunshine »
Happy to help
:)

michielper

  • EA User
  • **
  • Posts: 149
  • Karma: +2/-1
    • View Profile
Re: Making Add-Ins COM-visible
« Reply #5 on: May 26, 2020, 02:08:39 am »
Another problem creating an Addin:

The registry key HKEY_CURRENT_USER\Software\Sparx Systems\EAAddins
does not exist in my installation of EA 15.0. There is no key called EAAddins at all. So where and how should I register my Addin?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 10416
  • Karma: +343/-30
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Making Add-Ins COM-visible
« Reply #6 on: May 26, 2020, 03:54:41 am »
You can always create the key if it doesn't exist.

Geert

michielper

  • EA User
  • **
  • Posts: 149
  • Karma: +2/-1
    • View Profile
Re: Making Add-Ins COM-visible
« Reply #7 on: May 26, 2020, 05:59:07 pm »
You can always create the key if it doesn't exist.

Geert

Yes, but where does EA 15 look for the key?
It is not only the key that is missing but also a directory. Possibly EA15 expects the key in another place?!

Uffe

  • EA Practitioner
  • ***
  • Posts: 1775
  • Karma: +122/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Making Add-Ins COM-visible
« Reply #8 on: May 26, 2020, 06:42:02 pm »
Hi,

The AddIns key only gets created by Add-In installers, not by the EA installer. If it's there, EA scans it during startup; if not it doesn't.
But that only tells EA there are Add-Ins to look for. You must also register the Add-In DLL correctly so EA can actually load it.

/Uffe
My theories are always correct, just apply them to the right reality.

michielper

  • EA User
  • **
  • Posts: 149
  • Karma: +2/-1
    • View Profile
Re: Making Add-Ins COM-visible
« Reply #9 on: May 27, 2020, 06:19:28 pm »
Hi,

The AddIns key only gets created by Add-In installers, not by the EA installer. If it's there, EA scans it during startup; if not it doesn't.
But that only tells EA there are Add-Ins to look for. You must also register the Add-In DLL correctly so EA can actually load it.

/Uffe

Ok, thanks, it works now!