Book a Demo

Author Topic: Using a Addin Dll  (Read 4829 times)

TheTwo

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Using a Addin Dll
« on: June 18, 2008, 09:40:39 pm »
Hi,

I've developed an Addin for EA in C#. Now I have a problem how to use the dll when I don't start the add-in out of Visual Studio.

I've added the registry entry with the namespace of the project as key and the namespace plus the name of the entry method as value.
I've tried to copy the dll in the EA folder and the system32 folder.

But every time in the EA Addin Manager the status is "Error-Missing".

Thanks for help
TheTwo

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Using a Addin Dll
« Reply #1 on: June 18, 2008, 10:05:22 pm »
If your AddIn was loaded by EA when you started it from VS, this means that VS has registered the dll as COM component. For EA to find it on another machine, you need to register it (using regasm, cause regsvr32 won't work).

TheTwo

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Using a Addin Dll
« Reply #2 on: June 18, 2008, 10:20:42 pm »
Thanks,

now I get the error from regasm:

error RA0000 : Could not load file or assembly 'interop.EA, Version=2.10.238.1, Culture=neutral, PublicKeyToken=d28e1c76302f6a17' or one of its dependencies. Das System kann die angegebene Datei nicht finden.

TheTwo

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Using a Addin Dll
« Reply #3 on: June 18, 2008, 11:16:39 pm »
Maybe not the right .Net framework installed on the target machine. Or the AddIn compiled against another framework version. Or whatever. We had a lot of discussions a while back, see http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1208373036/0#0

Maybe something there gives you an idea.

TheTwo

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Using a Addin Dll
« Reply #4 on: June 19, 2008, 12:02:05 am »
I've found the solution. I have to call regasm with the switch "/codebase".

Therefor the dll must be "strong named" (signed with an snk file).

TheTwo
« Last Edit: June 19, 2008, 12:08:14 am by TheTwo »

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Using a Addin Dll
« Reply #5 on: June 19, 2008, 12:38:06 am »
Quote
Therefor the dll must be "strong named" (signed with an snk file).

There should be a solution without the need to sign the AddIn dll. Maybe your VS solution has something in its configuration which enforces this. Generally COM registration and COM object creation works with unsigned assemblies as well.

Anyway, if it doesn't bother you, it's allright.