473,785 Members | 2,317 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

COM Interop question in .NET 2.0

Hi,

I am trying to expose my .NET 2.0 class as a COM type using the following
attributes for the attributes

[ClassInterface( ClassInterfaceT ype.None)]
[Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]

I have the "Register for COM Interop" build property set to true. I also
have two functions in the class to register and unregister the COM with the
registry. But when i try to build it in VS.NET 2005, i get the following
error "XXX.dll does not contain any types that can be registered for COM
Interop" and "XXX.dll does not contain any types that can be Unregistered for
COM Interop". The same code works perfectly in VS.NET 2003. Anybody know of
any reasons why this is happeneing or what i am doing wrong?

Thank You,
Vish
Nov 17 '05 #1
26 10677
Vish,

Is it an error in the build process, or the registration process?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Vish" <Vi**@discussio ns.microsoft.co m> wrote in message
news:19******** *************** ***********@mic rosoft.com...
Hi,

I am trying to expose my .NET 2.0 class as a COM type using the following
attributes for the attributes

[ClassInterface( ClassInterfaceT ype.None)]
[Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]

I have the "Register for COM Interop" build property set to true. I also
have two functions in the class to register and unregister the COM with
the
registry. But when i try to build it in VS.NET 2005, i get the following
error "XXX.dll does not contain any types that can be registered for COM
Interop" and "XXX.dll does not contain any types that can be Unregistered
for
COM Interop". The same code works perfectly in VS.NET 2003. Anybody know
of
any reasons why this is happeneing or what i am doing wrong?

Thank You,
Vish

Nov 17 '05 #2
Vish,

Could it be that ComVisible is false by default now in 2.0? Try the
following example and see if it works.

[ClassInterface( ClassInterfaceT ype.None)]
[Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]
[ComVisible(true )]
Jason Newell
Vish wrote:
Hi,

I am trying to expose my .NET 2.0 class as a COM type using the following
attributes for the attributes

[ClassInterface( ClassInterfaceT ype.None)]
[Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]

I have the "Register for COM Interop" build property set to true. I also
have two functions in the class to register and unregister the COM with the
registry. But when i try to build it in VS.NET 2005, i get the following
error "XXX.dll does not contain any types that can be registered for COM
Interop" and "XXX.dll does not contain any types that can be Unregistered for
COM Interop". The same code works perfectly in VS.NET 2003. Anybody know of
any reasons why this is happeneing or what i am doing wrong?

Thank You,
Vish

Nov 17 '05 #3

"Vish" <Vi**@discussio ns.microsoft.co m> wrote in message
news:19******** *************** ***********@mic rosoft.com...
Hi,

I am trying to expose my .NET 2.0 class as a COM type using the following
attributes for the attributes

[ClassInterface( ClassInterfaceT ype.None)]
[Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]

I have the "Register for COM Interop" build property set to true. I also
have two functions in the class to register and unregister the COM with
the
registry. But when i try to build it in VS.NET 2005, i get the following
error "XXX.dll does not contain any types that can be registered for COM
Interop" and "XXX.dll does not contain any types that can be Unregistered
for
COM Interop". The same code works perfectly in VS.NET 2003. Anybody know
of
any reasons why this is happeneing or what i am doing wrong?

Thank You,
Vish


Don't know what exactly you do in the functions that register/unregister the
class, mind to post your code?
Willy.
Nov 17 '05 #4
Hi Jason,

Seems like that did the trick. i am able to build the class after setting
the ComVisible attribute of the class to true. I appreciate your help in this
matter.

Thank You,
Vish
"Jason Newell" wrote:
Vish,

Could it be that ComVisible is false by default now in 2.0? Try the
following example and see if it works.

[ClassInterface( ClassInterfaceT ype.None)]
[Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]
[ComVisible(true )]
Jason Newell
Vish wrote:
Hi,

I am trying to expose my .NET 2.0 class as a COM type using the following
attributes for the attributes

[ClassInterface( ClassInterfaceT ype.None)]
[Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]

I have the "Register for COM Interop" build property set to true. I also
have two functions in the class to register and unregister the COM with the
registry. But when i try to build it in VS.NET 2005, i get the following
error "XXX.dll does not contain any types that can be registered for COM
Interop" and "XXX.dll does not contain any types that can be Unregistered for
COM Interop". The same code works perfectly in VS.NET 2003. Anybody know of
any reasons why this is happeneing or what i am doing wrong?

Thank You,
Vish

Nov 17 '05 #5
Hi Nicholas,

The error occured while building. But i was able to solve the problem by
setting the ComVisible attribute to true on the class according to Jason's
reply. I think the ComVisible attribute is set to false by default where in
it was true by default in 1.1.

I appreciate your help in this matter.

Thank You,
Vish
"Nicholas Paldino [.NET/C# MVP]" wrote:
Vish,

Is it an error in the build process, or the registration process?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Vish" <Vi**@discussio ns.microsoft.co m> wrote in message
news:19******** *************** ***********@mic rosoft.com...
Hi,

I am trying to expose my .NET 2.0 class as a COM type using the following
attributes for the attributes

[ClassInterface( ClassInterfaceT ype.None)]
[Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]

I have the "Register for COM Interop" build property set to true. I also
have two functions in the class to register and unregister the COM with
the
registry. But when i try to build it in VS.NET 2005, i get the following
error "XXX.dll does not contain any types that can be registered for COM
Interop" and "XXX.dll does not contain any types that can be Unregistered
for
COM Interop". The same code works perfectly in VS.NET 2003. Anybody know
of
any reasons why this is happeneing or what i am doing wrong?

Thank You,
Vish


Nov 17 '05 #6
Hi Willy,

Jason's suggestion fixed my problem. Looks like the ComVisible property is
false by default in .NET 2.0 where in it was true by default in 1.1. If you
are still interested in looking at the code, let me know. I will post it. I
appreciate you help with this issue.

Thank You,
Vish
"Willy Denoyette [MVP]" wrote:

"Vish" <Vi**@discussio ns.microsoft.co m> wrote in message
news:19******** *************** ***********@mic rosoft.com...
Hi,

I am trying to expose my .NET 2.0 class as a COM type using the following
attributes for the attributes

[ClassInterface( ClassInterfaceT ype.None)]
[Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]

I have the "Register for COM Interop" build property set to true. I also
have two functions in the class to register and unregister the COM with
the
registry. But when i try to build it in VS.NET 2005, i get the following
error "XXX.dll does not contain any types that can be registered for COM
Interop" and "XXX.dll does not contain any types that can be Unregistered
for
COM Interop". The same code works perfectly in VS.NET 2003. Anybody know
of
any reasons why this is happeneing or what i am doing wrong?

Thank You,
Vish


Don't know what exactly you do in the functions that register/unregister the
class, mind to post your code?
Willy.

Nov 17 '05 #7
Can't be the reason as the default for ComVisible is still true.

Willy.

"Vish" <Vi**@discussio ns.microsoft.co m> wrote in message
news:03******** *************** ***********@mic rosoft.com...
Hi Willy,

Jason's suggestion fixed my problem. Looks like the ComVisible property is
false by default in .NET 2.0 where in it was true by default in 1.1. If
you
are still interested in looking at the code, let me know. I will post it.
I
appreciate you help with this issue.

Thank You,
Vish
"Willy Denoyette [MVP]" wrote:

"Vish" <Vi**@discussio ns.microsoft.co m> wrote in message
news:19******** *************** ***********@mic rosoft.com...
> Hi,
>
> I am trying to expose my .NET 2.0 class as a COM type using the
> following
> attributes for the attributes
>
> [ClassInterface( ClassInterfaceT ype.None)]
> [Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]
>
> I have the "Register for COM Interop" build property set to true. I
> also
> have two functions in the class to register and unregister the COM with
> the
> registry. But when i try to build it in VS.NET 2005, i get the
> following
> error "XXX.dll does not contain any types that can be registered for
> COM
> Interop" and "XXX.dll does not contain any types that can be
> Unregistered
> for
> COM Interop". The same code works perfectly in VS.NET 2003. Anybody
> know
> of
> any reasons why this is happeneing or what i am doing wrong?
>
> Thank You,
> Vish


Don't know what exactly you do in the functions that register/unregister
the
class, mind to post your code?
Willy.

Nov 17 '05 #8
Vish,

Willy is correct per documentation:
http://msdn2.microsoft.com/en-us/lib...US,VS.80).aspx.

I'd be interested to know why explicitly settings [ComVisible(true )]
fixed the problem. Unfortunately, I don't have 2.0 or I'd test it myself.

Jason Newell
Willy Denoyette [MVP] wrote:
Can't be the reason as the default for ComVisible is still true.

Willy.

"Vish" <Vi**@discussio ns.microsoft.co m> wrote in message
news:03******** *************** ***********@mic rosoft.com...
Hi Willy,

Jason's suggestion fixed my problem. Looks like the ComVisible property is
false by default in .NET 2.0 where in it was true by default in 1.1. If
you
are still interested in looking at the code, let me know. I will post it.
I
appreciate you help with this issue.

Thank You,
Vish
"Willy Denoyette [MVP]" wrote:

"Vish" <Vi**@discussio ns.microsoft.co m> wrote in message
news:19***** *************** **************@ microsoft.com.. .

Hi,

I am trying to expose my .NET 2.0 class as a COM type using the
following
attribute s for the attributes

[ClassInterface( ClassInterfaceT ype.None)]
[Guid("8D0240AD-1BBE-4831-8214-39DD46A4A797")]

I have the "Register for COM Interop" build property set to true. I
also
have two functions in the class to register and unregister the COM with
the
registry. But when i try to build it in VS.NET 2005, i get the
following
error "XXX.dll does not contain any types that can be registered for
COM
Interop" and "XXX.dll does not contain any types that can be
Unregistere d
for
COM Interop". The same code works perfectly in VS.NET 2003. Anybody
know
of
any reasons why this is happeneing or what i am doing wrong?

Thank You,
Vish

Don't know what exactly you do in the functions that register/unregister
the
class, mind to post your code?
Willy.


Nov 17 '05 #9

"Jason Newell" <no****@nospam. com> wrote in message
news:Oe******** ******@TK2MSFTN GP15.phx.gbl...
Vish,

Willy is correct per documentation:
http://msdn2.microsoft.com/en-us/lib...US,VS.80).aspx.

I'd be interested to know why explicitly settings [ComVisible(true )] fixed
the problem. Unfortunately, I don't have 2.0 or I'd test it myself.

Jason Newell


And not only per documentation ;-), it was the default since version 1.0 and
did not change in v2.0 (that would be a breaking change).
I tested this with v2.0 and I can confirm 'true' is still the default.

Willy.
Nov 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2362
by: roy | last post by:
I try to call com written in VB 6.0. When I use VS.net Studio to do the debuging, some time it works fine, some time I got the following message: Server Error in '/GISOnlineReservation' Application. ----------------------------------------------------------- --------------------- Configuration Error Description: An error occurred during the processing of a
0
1569
by: roy | last post by:
I try to call com written in VB 6.0., some time it works fine, some time I got the following message: Server Error in '/GISOnlineReservation' Application. ----------------------------------------------------------- --------------------- Configuration Error Description: An error occurred during the processing of a configuration file required to service this request.
0
2289
by: keefah | last post by:
Hi, I'm writing a C# web app that uses Outlook to send email. I use a reference to the Microsoft Outlook 11.0 Object Library, but it's giving me problems. I tracked down some stuff on the Net about the global assembly cache (GAC) and primary interop assemblies (PIA) and so forth, and did all the recommendations, in terms of tweeking Office, installing the .NET Office stuff for framework 1.1, etc. I got it to the point where it compiles ok,...
0
2791
by: lacour | last post by:
I can't seem to figure out the difference between adding a COM dll reference in VS2003 and by using TLBIMP. I have a COM dll that references another COM dll, and I want the syntax of my interop-filenames to be interop.<NameOfCOMDLL>.dll I now make the first interop file tlbimp COM1.dll /out:interop.COM1.dll /namespace:COM1
1
1999
by: Nadav | last post by:
Hi, Introduction *************** I have a system build of a collection of 'Native COM objects' and '.NET COM interop' objects, all of the COM objects are managed through a 'Native COM' layer, this layer manage the underlying COM Objects and upon request, provide a pointer to those objects to the 'API Consumer', following is an illustration of the system: API Consumer ( Native C++/C# ) || ******************************************* * ...
8
3424
by: Rob Edwards | last post by:
When trying to add the Microsoft CDO for Exchange Management Library (aka CDOEXM.dll) I receive the following message: "A reference to 'Microsoft CDO for Exchange Management Library' could not be added. Converting the type library to a .Net assembly failed. A depended type library 'CDO' could not be converted to a .NET assembly. A dependent type library 'ADODB' could not be converted to a .NET assembly. Item has already been added." ...
7
10964
by: R Reyes | last post by:
Can someone please explain to me why I can't get the MS Word Interop assembly to work in my VS2005 project? I'm trying to manipulate MS Word from my Web Form application and I can't get passed this screen below. Please help, thanks in advance... Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify...
2
7305
by: JC | last post by:
Anybody knows what problem has this code? I think, in the Garbage Collector? You know the Solution? The program in the test's case, whit 350 contacts, run OK before number 86. The error is a "Array index out of bounds". Microsoft.Office.Interop.Outlook._Application olApp = new Microsoft.Office.Interop.Outlook.ApplicationClass(); Microsoft.Office.Interop.Outlook._NameSpace olNs = olApp.GetNamespace("MAPI");
1
2872
by: allbelonging | last post by:
C#.Net Outlook 2003 automation (programmatically) with Office.Interop.Outlook Problem: I have my outlook 2003 configured with multiple mailbox on my local machine. I want to specify the mailbox and server (Exchange server mail box) to connect and then save the mailitems(from Inbox or any other folder) based on a filter to a*.msg file. I want to achieve this using only one Interop dll if this is possible. Tried so far:
0
2058
by: Tina | last post by:
I've gotten this before where it says there is a problem with Interop.MSDASC but I can't remember what causes this. This is a 1.1 app I'm trying to debug in vs2005. It was running yesterday just fine. Help! T Server Error in '/VT.Users' Application. -------------------------------------------------------------------------------- Configuration Error
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10085
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9947
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5379
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4045
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.