none
Warning: (dll) does not contain any types that can be unregistered for COM Interop RRS feed

  • Question

  • I am getting a warning in a large project that I cannot clear.

    "(dll) does not contain any types that can be unregistered for COM Interop" and also "(dll) does not contain any types that can be registered for COM Interop".

    I have searched the Microsoft website and the web without finding anything useful. I would like to know whether or not it is important and, regardless of whether it is, how to clear it or at least suppress it. I can't even suppress it because there does not appear to be a warning number.

    Rick Harrison

     

    Thursday, November 16, 2006 2:13 AM

All replies

  • This same "warning" (which sounds like a fatal error, if it's true) is also happening for me
    (VS 2005 on Win XP Pro) and has also been reported on the web at the following posts. 
    From reading these posts, it would appear that often the problem just goes away when
    the programmer does something that should not really have any effect on the situation...
    and I've tried each thing that cleared it up for someone else, and none have worked for me.

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

      - http://www.developersdex.com/csharp/message.asp?p=1111&r=4536059

      - http://www.developersdex.com/vb/message.asp?p=2920&ID=%3CuUkZB8GJGHA.3728%40tk2msftngp13.phx.gbl%3E

    • Proposed as answer by jblp Tuesday, July 21, 2009 1:30 AM
    Thursday, November 30, 2006 6:13 PM
  •  

    Do you have the <RegisterForComInterop> property set to true in the offending project? If so can you simply remove it?

    Let us know if that's it.

    Dan

    Thursday, November 30, 2006 7:44 PM
    Moderator
  •  DanMoseley - MSFT wrote:

     

    Do you have the <RegisterForComInterop> property set to true in the offending project? If so can you simply remove it?

    Let us know if that's it.

    Dan

     

    I have the same problem when building a class library. I am developing the class library that will be used in a unmanaged environment (C). And yes I have set the property <RegisterForComInterop> to true. It is unclear to me if I can simply ignore the warning. Unsetting the property and rebuilding my class library results in no more warnings.

     

    But I want to use the property <RegisterForComInterop> since I want to auto register my class library every time I change my code. Registering my class library using the command line REGASM.EXE mydll.dll /tlb:mydll.tlb seems to work fine (assembly exported and type library registered). Of course, I could use a post-build event to call REGASM.EXE but I shouldn't have to since the IDE provides the same functionality by setting the property <RegisterForComInterop>.

     

    So, if anybody could please clarify:

    1) why do I get the (un)register warnings when property <RegisterForComInterop> is set

    2) can I simply ignore these warnings (and how to surpress if possible)

     

    Regards,

    Mark

    Monday, February 18, 2008 12:02 PM
  • I had the same problem for one project. It is caused by an error in the registry.
    I solved it in the followwing way:

    - I save the code of my class library in wordpad
    - I deleted the original project
    -I created a new project with a different name. I pasted the code of the original project.
    - open project properties: don't forget to make the project com visible and register to com to create a .tlb file, build and save all.
    -To repare the registry I used clean-up utilities (other programs could probably be used)

    and it was OK
    Tuesday, July 21, 2009 1:38 AM
  • I had the same problem anytime I checked the "Register For COM interop" option for my C# projects.  There is an easy solution:

    While in the Solution Explorer, go to the Properties folder.  Open the AssemblyInfo.cs file.  Scroll down to the line that says:
    [assembly: ComVisible(false)]

    Change this to:
    [assembly: ComVisible(true)]

    This will remove the warning messages, and allows the .tlb file to be created, which then enables the .NET code for COM visibility.  

    If you don't want to change the ComVisible attribute to true for the entire assembly, insert this line right above your class declaration:
    [ComVisible(true)]
    • Proposed as answer by Tzach Solomon Wednesday, November 24, 2010 3:35 PM
    Saturday, August 1, 2009 4:12 AM
  • If your project is set to register for interop, then at least one class must be exposed to COM.  The Assembly attribute listed above, or better to use this before a class that you wish to expose to COM, thereby only exposing those classes that should be COM visible.


    Thursday, August 13, 2009 11:00 AM
  • I have followed all the steps but tlb file cannot be generated.
    Please help!!

    (1) sn -k Sample1.snk
    (2) set [assembly: ComVisible(true)]
    (3) signing to browse for snk file
    (4) rebuild class library
    Thursday, October 8, 2009 5:05 AM
  • Hi,

    here is a helpful article about that: http://social.msdn.microsoft.com/forums/en-US/csharpgeneral/thread/871da777-131f-49e8-80ce-1bbc81d79e07

    I had the same problem, beacause I don't want to make the whole assembly ComVisible true, I added it only to the desired types and interfaces (like in the article), but additonally I made some of the methods to ComVisible false only in the interface and I get the described warning, after I add the ComVisibleAttribute also to the methods in the class the warning disappears.

    Hope that could help somebody.

    Monday, February 21, 2011 9:26 AM
  • You need to add below 2 line in your class when you configure the Project is Register Com Interop

    namespace mytest
    {
        [ComVisible(true)]
        [ClassInterface(ClassInterfaceType.AutoDual)]
        public class Class1
        { ....

    Wednesday, October 2, 2019 1:36 AM