.NET assembly only PARTIALLY exposed to COM

A

Andrew J. Marshall

I built my assembly with the "Register for COM Interop" box checked.

I could reference my assembly and see the classes, but IntelliSense and the
Object Browser could not see the methods nor properties.

I used TlbExp and RegAsm with the same result.

How can I get IntelliSense and Object Browser to see the details of my
classes?

Thanks,
Andrew J. Marshall
MCP (Visual Basic)
Fairfax, VA
 
A

Andrew J. Marshall

Sorry for replying to my own post, but ...

This article http://www.u2u.net/ArticlePage.aspx?ART=msdncominterop by
Patrick Tisseghem is awesome and it gave me my answer ...

You need to (in VB.NET)
* import System.Runtime.InteropServices
* and prefix the class declaration with
"<ClassInterface(ClassInterfaceType.AutoDual)>"
for example, <ClassInterface(ClassInterfaceType.AutoDual)> Public Class
Foo

Rebuild and, VOILA, IntelliSense and Object Browser are happy.

Andrew J. Marshall
MCP (Visual Basic)
Fairfax, VA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top