none
To distinguish w.r.t .NET dll(pure) and .NET dll with COM Interface RRS feed

  • Question

  • Hi All,

    I have a set of .NET dll's/assemblies (pure) as well as .NET dll's with COM Interfaces, Could it be possible to identify/segregate the dll's /assemblies belonging to the above two categories.

    I tried using the Regasm <abc.dll>

    Microsoft (R) .NET Framework Assembly Registration Utility 4.0.30319.1
    Copyright (C) Microsoft Corporation 1998-2004.  All rights reserved.

    Types Registered Successfully,

    ii) Regasm.exe <xyz.dll>

    Microsoft (R) .NET Framework Assembly Registration Utility 4.0.30319.1
    Copyright (C) Microsoft Corporation 1998-2004.  All rights reserved.

    RegAsm : warning RA0000 : No types were registered

    I would categorize the former assembly(abc.dll) has .NET dll with COM Interface and latter (xyz.dll) into pure Or ha .NET dll/assembly only. Is my approach is correct OR  Is there any other method to segregate the above dll's or assemblies.

    Details:

    VS 2008 IDE, Windows 7 O/S.,

    Regards,

    VishalK_90


    Vishal_K89

    Tuesday, June 4, 2013 5:54 AM

Answers

  • If you are just wanting to know if the managed assembly has any "COM visible code" in there (without having to pull the source for it), then you can definitely rely on regasm's output of whether there were any types registered or not on its invocation.

    If you want to be very sure, you can run regasm with /tlb switch and open the generated tlb with Ole/COM Object Viewer and see if there are types exposed in there.

    Hope this helps!



    Tuesday, June 4, 2013 7:28 PM

All replies

  • If you are just wanting to know if the managed assembly has any "COM visible code" in there (without having to pull the source for it), then you can definitely rely on regasm's output of whether there were any types registered or not on its invocation.

    If you want to be very sure, you can run regasm with /tlb switch and open the generated tlb with Ole/COM Object Viewer and see if there are types exposed in there.

    Hope this helps!



    Tuesday, June 4, 2013 7:28 PM
  • You can also automate this process by loading an assembly, Iterating through all the types in that assembly and call Marshal.IsTypeVisibleFromCom to see if the type is ComVisible


    Wednesday, June 5, 2013 3:54 PM