all groups > dotnet interop > july 2003 >
You're in the

dotnet interop

group:

Regasm warning: no types were registered


Regasm warning: no types were registered msnews.microsoft.com
7/28/2003 12:25:28 PM
dotnet interop:
Here is my problem.

I have access to existing c# code of an assembly that I want to expose to
COM clients. The c# code has elaborate class hierarchy and interfaces so
there is no particular class I can expose that will follow rules of COM
callable class. So here is what I did:

1. Add a new c# class [lets say this is ComInterop class] that has a default
parameterless constructor.
2. add public methods to ComInterop class that pretty much call other
classes in same library to delegate functionality
3. compiled the code
4. Ran regasm to register the dll for COM

but I get

regasm warning: no types were registered

I look at the typelib by separately exporting it using tlbexp but I don't
see any classes exposed to the COM [including ComInterop class].

I thought that I am having this problem because other classses are not
suitable for exposing to COM, so I even went ahead and marked all other
classes except my com interopable class with ComVisible(false) attribute,
still no effect.

I even tried [ClassInterface(ClassInterfaceType.AutoDispatch)] attribute
with Autodual and AutoDispatch both for the class and still no effect
[typelib still doesn't expose my interop class, I don't see it in the IDL
and I get the same warning in regasm].

Anyone has any ideas why this could be happening?

The only other alternative for me would be try out separating COM callable
class in its own separate assembly that then calls into original c# code I
want to call.

Let me know if you have any ideas. TIA.

Re: Regasm warning: no types were registered msnews.microsoft.com
7/28/2003 2:49:30 PM
David,

You are absolutely right. I missed looking at the assemblyinfo file and sure
enough there is a Comvisible set to false at assembly level.

I'll try to override and set that to true but don't know how much success
I'll have, I'll let you know.

BTW, when I separated the cominterop class in a separate assembly and marked
it with ClassInterface and AutoDual, the interop class and all its public
stuff showed up in the typelib.

Thanks a bunch for your hint.

[quoted text, click to view]

RE: Regasm warning: no types were registered a-davids NO[at]SPAM online.microsoft.com
7/28/2003 6:36:17 PM
Do you have a ComVisibleAttribute at the assembly level? If so, you may
need ComVisible(true) on the class(es) and interfaces you want to use from
COM.

Dave Stucki
Microsoft Developer Support
AddThis Social Bookmark Button