Ant_Mak

When I trying to build my *.dll compiler shows this warning:

Warning 1 "D:\Works\1.0.2.1\TTConfig\TTConfig\bin\Release\TTConfig.dll" does not contain any types that can be registered for COM Interop.

What's wrong


Re: .NET Base Class Library Can't register assembly for COM Interop

Inbar Gazit - MSFT

Did you set the COMVisible Attribute on your classes




Re: .NET Base Class Library Can't register assembly for COM Interop

Martin Xie - MSFT

Hi Ant_Mak, you need check your program.

Please set the "Register for COM Interop" property to true in the configuration properties page.

using System.Runtime.InteropServices;

Add these settings in your program or AssemblyInfo.cs file.

[Guid("E1916BD8-A8AA-47b7-A862-C1AF995E64EF")]

[ComVisible(true)] //this value is false by default

This thread may be helpful to you How to create a COM Component in VS.Net.

Please have a look at some samples and solutions in the following links.

http://forums.esri.com/Thread.asp c=93&f=993&t=190246

http://forums.esri.com/Thread.asp c=93&f=1170&t=181067

Aslo see these threads with similar topic.

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=928366&SiteID=1
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=76807&SiteID=1

 
 
 





Re: .NET Base Class Library Can't register assembly for COM Interop

Ant_Mak

The problem is solved!
I spend some time searching forum and find answer:

Explicit declaration of default constructor is required for COM classes.

I forgot to write it.
Now everything is OK.

Thanks for help!





Re: .NET Base Class Library Can't register assembly for COM Interop

Martin Xie - MSFT

Thank you for sharing your valuable experience with us here!Smile