Groups | Blog | Home
all groups > dotnet interop > april 2006 >

dotnet interop : Deploying .NET COM wrapper


rosedb0 NO[at]SPAM gmail.com
4/6/2006 11:35:18 AM

I'm having a little trouble deploying a .NET DLL, and I was wondering
if anyone here could help.

Basically, I've built a DLL to expose some .NET components to COM.
After building the DLL and running "regasm /tlb" and "gacutil", I can
call these components from VB6 on the development machine without any
problem.

The problem arises when I try to deploy this DLL to another machine and
try to call the code from VB6. Once again, I'm using "regasm /tlb" and
"gacutil" to ensure that the DLL is registered with COM. In this case,
Visual Basic "sees" the COM object (i.e., it shows up in the
"References" dialog box under "COM"), but I can't seem to access any of
the NET components. In other words, Intellisense doesn't know about any
of the classes or interfaces declared in the COM object, and trying to
invoke any of these components gives compile-time errors.

What step am I missing/what am I doing wrong?

--Dave
Phil Wilson
4/6/2006 12:05:09 PM
Regasm /tlb generates and registers a type library. I think you're finding
that it is not registering the COM classes in your .NET assembly. That's
easily checked if you have specified a GuidAttribute for the class - see if
it's in the registry at HKCR\CLSID\{Guid}.
--
Phil Wilson [MVP Windows Installer]
----
[quoted text, click to view]

Wayne Sepega
4/10/2006 9:02:53 AM
I was having the same issue, here is what I found (with some help from the
group)

If you are using .net 2.0, you assemblyinfo.cs has [assembly:
ComVisible(false)], this makes everything non com visible. The help says by
default everything is ComVisible, but with the attribute set to false this
is not true.

Also regasm /tlb says it generates a TLB and registers the assembly. It
creates the TLB OK, but no registration. Just run regasm Assembly.DLL to
register your assembly.

Changing the two items above hopefully will get your assembly registered and
useable.

Thanks
Wayne


[quoted text, click to view]

AddThis Social Bookmark Button