Author Topic: Deploying a .NET/COM assembly on multiple machines  (Read 4891 times)

Martin Aspeli

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Deploying a .NET/COM assembly on multiple machines
« on: July 16, 2009, 12:55:48 pm »
Hi,

I've built an add-in using Visual C# express. My bin/release folder contains:

  MYCOMPANY EA.dll
  MYCOMPANY EA.pdb
  MYCOMPANY EA.reg
  MYCOMPANY EA.tlb
  MYCOMPANY_EA.dll
  MYCOMPANY_EA.pdb
  MYCOMPANY_EA.reg
  MYCOMPANY_EA.tlb

I really don't know why I have both versions with underscore and with a space (the file sizes are different!). Looks like the underscore versions are the ones that are used, though.

To .reg file contains instructions to set up various things in HKEY_CLASSES_ROOT. It basically has everything I see in the registry, except the CodeBase key:

Code: [Select]
REGEDIT4

[HKEY_CLASSES_ROOT\MYCOMPANY_EA.Plugin]
@="MYCOMPANY_EA.Plugin"

[HKEY_CLASSES_ROOT\MYCOMPANY_EA.Plugin\CLSID]
@="{72A3C8EC-6836-3535-AF86-BB1FB99D7D0D}"

[HKEY_CLASSES_ROOT\CLSID\{72A3C8EC-6836-3535-AF86-BB1FB99D7D0D}]
@="MYCOMPANY_EA.Plugin"

[HKEY_CLASSES_ROOT\CLSID\{72A3C8EC-6836-3535-AF86-BB1FB99D7D0D}\InprocServer32]
@="mscoree.dll"
"ThreadingModel"="Both"
"Class"="MYCOMPANY_EA.Plugin"
"Assembly"="MYCOMPANY EA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
"RuntimeVersion"="v2.0.50727"

[HKEY_CLASSES_ROOT\CLSID\{72A3C8EC-6836-3535-AF86-BB1FB99D7D0D}\InprocServer32\1.0.0.0]
"Class"="MYCOMPANY_EA.Plugin"
"Assembly"="MYCOMPANY EA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
"RuntimeVersion"="v2.0.50727"

[HKEY_CLASSES_ROOT\CLSID\{72A3C8EC-6836-3535-AF86-BB1FB99D7D0D}\ProgId]
@="MYCOMPANY_EA.Plugin"

[HKEY_CLASSES_ROOT\CLSID\{72A3C8EC-6836-3535-AF86-BB1FB99D7D0D}\Implemented Categories\{62C8FE65-4EBB-45E7-B440-6E39B2CDBF29}]

To make the plugin work I also have to add HKEY_CURRENT_USER/Software/Sparx Systems/EAAddins/MYCOMPAY_EA with a default key of MYCOMPANY_EA.Plugin.

This works on my development machine, but I now need to deploy it to a number of other users. Here I'm a little lost.

I can create a .reg file to create the EAAddins entry, and run this + the generated file shown above. That still doesn't tell .NET where to find the DLL, though, as there's no CodeBase.

Where should I put the DLL file?

Do I need to run any .NET tools? The Sparx documentation refers to regsvr32, but this clearly doesn't apply to .NET/COM assemblies like this one.

Is there a better way?

Thanks,
Martin

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Deploying a .NET/COM assembly on multiple mach
« Reply #1 on: July 16, 2009, 03:03:20 pm »
You are looking for the "Assembly Registration Tool" regasm.exe
Look here: http://msdn.microsoft.com/en-us/library/tzat5yw6(VS.71).aspx for details.

Geert

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Deploying a .NET/COM assembly on multiple mach
« Reply #2 on: July 16, 2009, 03:12:20 pm »
The page in the help file regarding deployment of Add-Ins has been updated in the latest build (846) to better describe how to register an Add-In built using .NET.

Quote
If compiled as a .NET DLL, such as C# or VB.NET, register the DLL using the RegAsm command from the command prompt; for example:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe "C:\Program Files\MyCompany\EAAddin\EAAddin.dll" /codebase
 

Martin Aspeli

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Deploying a .NET/COM assembly on multiple mach
« Reply #3 on: July 16, 2009, 03:34:58 pm »
Hi Aaron - is this information on the web somewhere as well?

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: Deploying a .NET/COM assembly on multiple mach
« Reply #4 on: July 16, 2009, 04:16:08 pm »
There is a pdf version of the Help (including the topic Aaron quoted) on:

http://sparxsystems.com/bin/EAUserGuide.pdf

The UML Tool Guide web pages have not yet been brought up to date.
Best Regards, Roy