Author Topic: Regasm does not work  (Read 25422 times)

yellowface

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Regasm does not work
« on: April 17, 2008, 05:10:36 am »
Hello every1:

I have a wired problem with regasm.exe right now. Here is the situation:
I am developing an EA Add-In right now. When I select output type as Class Library, also I checked the Register for COM Interop(in this case, I do not need to run regasm add-in.dll for registering), EA can successfully load my add-in without any problems. I tried regasm add-in.dll /unregister and opened EA, the add-in is not there for sure(regasm /unregister works in this case)
However, if i did not check the register for COM Interop when I do the output with Class Library and using regasm to register my add-in(it shows successfully register), but EA cannot load my Add-IN, showing  Error-Missing.
Any1 has any ideas what is wrong with that? I have .Net SDK installed and develop environment is VS.2003.

Thank you very much if any1 here can help me.

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Regasm does not work
« Reply #1 on: April 17, 2008, 05:53:12 pm »
It's about Visual Studio .Net I suppose.

Maybe when you don't check "Register for COM Interop" VS doesn't create the type library, i.e. your dll with its public class can be registered by regasm, but VS does not create GUIDs and stuff for the public functions, so EA will not find the entry points it needs.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Regasm does not work
« Reply #2 on: April 17, 2008, 09:52:50 pm »
And make sure you tell .Net to make the appropriate classes, methods etc. COM-visible, or you still won't see them in the compiled file (and nor will COM).

You'll need to add some .Net attributes to your assembly, classes, methods, properties, etc. The .Net documentation covers this in detail. When you set up a project by hand these are done for you. I'm not sure if changing it later works, but I think you can do it (at least with VS 2005 and later).

Failing to do this is a common error when retrofitting a project by hand for COM visibility.

David
No, you can't have it!

yellowface

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Regasm does not work
« Reply #3 on: April 18, 2008, 09:36:45 pm »
i found solution. guess what? lol
i should do regasm name.dll /codebase, then the lib got registered.
if i do regasm name.dll   never works. grrr....

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Regasm does not work
« Reply #4 on: April 20, 2008, 09:56:31 pm »
Excellent!

Or so it appears. Just to confirm, did this solve the entire problem?

We're seeing a problem reported elsewhere that might have some common elements.

David
No, you can't have it!

vibhugupta

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Regasm does not work
« Reply #5 on: May 02, 2008, 05:14:16 pm »
This didn't solve the problem.

I am developing an EA Add-In right now. When I select output type as Class Library, also I checked the Register for COM Interop(in this case, I do not need to run regasm add-in.dll for registering), EA can successfully load my add-in without any problems.

In this case also EA is not loading the addin and my addin doesn't display. I also tried by registering using regasm add-in.dll /register
add-in.dll /codebase, it's not working.

I feel this is not a solution for the problem.

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Regasm does not work
« Reply #6 on: May 05, 2008, 03:06:26 pm »
Yellowface / Vibhu,

A couple of thoughts:

1) Can you confirm that you are referencing Interop.EA.dll in your .NET Add-In projects and not EA.TLB?  For .NET projects, it is important to reference via the Interop and not the typelib.

2) Where are you deploying your Add-In dll?  Sometimes for best results you might consider installing the DLL within the some folder where EA is installed.

vibhugupta

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Regasm does not work
« Reply #7 on: May 05, 2008, 03:55:36 pm »
Aaron!


1)I tried referencing Interop.EA.dll from EA trial installation folder bot it was giving error so I read on the same forum and add EA.tlb as reference and it started working.

2) Doesn't metter where to deploy addin dll. I have tried all that but it didn't work.

Vibhu

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Regasm does not work
« Reply #8 on: May 05, 2008, 09:43:37 pm »
Quote
Yellowface / Vibhu,

A couple of thoughts:

1) Can you confirm that you are referencing Interop.EA.dll in your .NET Add-In projects and not EA.TLB?  For .NET projects, it is important to reference via the Interop and not the typelib.

2) Where are you deploying your Add-In dll?  Sometimes for best results you might consider installing the DLL within the some folder where EA is installed.
Just wondering aloud...

Perhaps the version of .Net that the (Sparx version of the) Interop was built against is posing an upward compatibility problem for those still developing against .Net 1.x.

If so, might this problem be solved by creating another Interop assembly using .Net 1.1 (for example), which these developers could link against?

This might pose problems of its own though. First, I don't know if it is even possible, or practical. Second, there might be issues with the assembly cache - global or otherwise. In the latter case these might not show up until an end user installed enough add-ins that both Interop assemblies were in play. Perhaps the issues wouldn't even show up until both versions were loaded by EA at run-time...

David
No, you can't have it!

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Regasm does not work
« Reply #9 on: May 06, 2008, 12:12:39 am »
One more shot in the dark:

If you have an AddIn created with Visual Studio 2003 (i.e. Net 1.1) and a machine on which it is registered but doesn't show, you can force EA to load it with .Net Framework 1.1 (even if .Net Framework 2.0 is installed as well) by placing a file "EA.exe.config" in the EA program folder. The file has to contain this text:

Code: [Select]
<?xml version ="1.0"?>
<configuration>
    <startup>
        <supportedRuntime version="v1.1.4322"/>
    </startup>
</configuration>

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Regasm does not work
« Reply #10 on: May 06, 2008, 01:25:20 am »
Thanks Frank!

That sounds like just the key.
No, you can't have it!

vibhugupta

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Regasm does not work
« Reply #11 on: May 07, 2008, 04:37:06 pm »
Dear Frank / David!

I followed Frank's suggestion but it didn't work.

As per David when I tried new addin by adding the reference to Interop.EA.dll (EA 7.1 trial) it was giving error then I tried by adding the reference to EA.tlb. It added and my addin displayed on my machine. When I tried the same addin on two other machines it displayed on one and didn't on other machine.

This is a strange problem. I am not getting what the issue is ??

Please suggest me what to do to avoid this problem

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Regasm does not work
« Reply #12 on: May 07, 2008, 05:03:14 pm »
Vibhu,

can you compare the registry entries on the two machines (the one where your AddIn shows and the one where it doesn't)?
They should look like this (My AddIn is called "ITensiveEAFunctions" and has a public class "Main" implementing the required event handlers):

1. There must be a key with LibraryName.ClassName for EA to find the Guid of the COM object to create:

Code: [Select]
HKEY_CLASSES_ROOT\ITensiveEAFunctions.Main\CLSID

with a Guid value ({709BE3C9-91CE-3F20-A2E9-4B0298F873E7} in my case).

 2. For the Guid (ClassID) there must be an entry pointing to the code base:

Code: [Select]
HKEY_CLASSES_ROOT\CLSID\{709BE3C9-91CE-3F20-A2E9-4B0298F873E7}

with subkeys Implemented Categories, InprocServer32 and ProgID. The InprocServer32 key contains a value "RuntimeVersion" and a subkey for the current version, which again has a RuntimeVersion value.

Could you check if these keys are identical on both machines?

For comparison, here's the complete CLSID key for my AddIn:

Code: [Select]
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\CLSID\{709BE3C9-91CE-3F20-A2E9-4B0298F873E7}]
@="ITensiveEAFunctions.Main"

[HKEY_CLASSES_ROOT\CLSID\{709BE3C9-91CE-3F20-A2E9-4B0298F873E7}\Implemented Categories]

[HKEY_CLASSES_ROOT\CLSID\{709BE3C9-91CE-3F20-A2E9-4B0298F873E7}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}]

[HKEY_CLASSES_ROOT\CLSID\{709BE3C9-91CE-3F20-A2E9-4B0298F873E7}\InprocServer32]
@="mscoree.dll"
"ThreadingModel"="Both"
"Class"="ITensiveEAFunctions.Main"
"Assembly"="ITensiveEAFunctions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
"RuntimeVersion"="v2.0.50727"
"CodeBase"="file:///E:/NetProj2/ITensive/Development/ITensiveEAFunctions/bin/Debug/ITensiveEAFunctions.dll"

[HKEY_CLASSES_ROOT\CLSID\{709BE3C9-91CE-3F20-A2E9-4B0298F873E7}\InprocServer32\1.0.0.0]
"Class"="ITensiveEAFunctions.Main"
"Assembly"="ITensiveEAFunctions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
"RuntimeVersion"="v2.0.50727"
"CodeBase"="file:///E:/NetProj2/ITensive/Development/ITensiveEAFunctions/bin/Debug/ITensiveEAFunctions.dll"

[HKEY_CLASSES_ROOT\CLSID\{709BE3C9-91CE-3F20-A2E9-4B0298F873E7}\ProgId]
@="ITensiveEAFunctions.Main"

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Regasm does not work
« Reply #13 on: May 07, 2008, 10:15:41 pm »
Quote
Dear Frank / David!

I followed Frank's suggestion but it didn't work.

As per David when I tried new addin by adding the reference to Interop.EA.dll (EA 7.1 trial) it was giving error then I tried by adding the reference to EA.tlb. It added and my addin displayed on my machine. When I tried the same addin on two other machines it displayed on one and didn't on other machine.

This is a strange problem. I am not getting what the issue is ??

Please suggest me what to do to avoid this problem
Long shot here...

This is one of the really obvious questions - along the lines of "is the computer plugged in?" - but still worth asking.

Can you confirm that all your machines have the .Net 1.1 runtime installed? Perhaps they have only .Net 2.0, or that plus .Net 1.0.

Also, if they do have .Net 1.1 installed, insure that the service packs for .Net are also current.

David
No, you can't have it!

vibhugupta

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Regasm does not work
« Reply #14 on: May 08, 2008, 10:30:33 pm »
David!

This is really obvious questions - along the lines of "is the computer plugged in?" - but still worth asking.

my machines have the .Net 1.1 runtime installed. Also the service pack of .net 1.1 are current.

I have installed the .net runtime on all the machines from the same setup file. On some machines addin is displaying and on another it's not displaying.