469,283 Members | 2,349 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,283 developers. It's quick & easy.

Problem in generating .Tlb file form .NET 2005 assemblies

Hi all,
The type library is an important file for COM interop, without which
unmanaged code can't interact with managed code.
When I use .NET 2003, I can sucessfully generate .tlb file from a .NET Dll
(built with /clr:oldsyntax switch) - using tlbexp or Regasm /tlb.
The above technique never works for .NET 2005. (Both for Beta1 & Beta2).
The thing is that a .tlb file gets generated with an empty library statement
block, ano NO types are exported in the .tlb file.

We tried it several time in our HCLT lab using the tlbexp or the Regasm
utility which comes with .NET 2005. We also tried with the older vertion of
the regasm or tlbexp - but nothing works.
Where is the problem ? is it in the latest version of the IDE or with the
latest tlbexp or regasm utility?

Please advice

Sincerely
Sanjoy Sinharoy
HCLT - INDIA

Jul 22 '05 #1
2 1947
I don't have 2005 in front of me now, but I think there is an attribute
that must be applied to each public method that needs to be exposed to
COM. I think it is called ComVisible.

So you might have (in VB.Net code here):

<ComVisible(True)> _
Public Sub ExposedToCom()
. . .
End Sub

Jul 22 '05 #2
Thanks Chris, You are right. It works.

Regards
Sanjoy
"Chris Dunaway" wrote:
I don't have 2005 in front of me now, but I think there is an attribute
that must be applied to each public method that needs to be exposed to
COM. I think it is called ComVisible.

So you might have (in VB.Net code here):

<ComVisible(True)> _
Public Sub ExposedToCom()
. . .
End Sub

Jul 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Iain Bishop | last post: by
15 posts views Thread by Ken Allen | last post: by
10 posts views Thread by Saso Zagoranski | last post: by
5 posts views Thread by Segfahlt | last post: by
2 posts views Thread by Jeff | last post: by
19 posts views Thread by Larry Smith | last post: by
reply views Thread by James | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.