Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 420187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:51:05+00:00 2026-05-12T18:51:05+00:00

I’m attempting to expose our library via COM but seem to be fighting the

  • 0

I’m attempting to expose our library via COM but seem to be fighting the tools more than the actual problem. Regardless of how I write my COM exposed class I get the warning: “XXX.dll does not contain any types that can be registered for COM interop” (marked project as Register for COM interop in the project properties). Even the simple class below (as the only class in an assembly that is signed and marked with ComVisible(false)) still warning persists:

  [Guid("77699130-7D58-4d29-BE18-385871B000D1")]
  [ComVisible(true)]
  public interface IExample
  {
    string GetText();
    void SetText(string text);
  }

  [Guid("F91E5EE1-D220-43b5-90D1-A48E81C478B7")]
  [ComVisible(true)]
  public class Example : IExample
  {
    private string m_text = "default text";

    public string GetText()
    {
      return m_text;
    }

    public void SetText(string text)
    {
      m_text = text;
    }
  }

I’ve tried to run regasm from the command line on the output which gladly states “Types registered successfully”. However, running with the /verbose switch no extra information is displayed (I seem to recall that it lists the name or perhaps just the number of registered types). Also tried running regasm with the /regfile switch to generate a regfile which generates this:

[HKEY_CLASSES_ROOT\ComExample.Example]
@="ComExample.Example"

[HKEY_CLASSES_ROOT\ComExample.Example\CLSID]
@="{F91E5EE1-D220-43B5-90D1-A48E81C478B7}"

[HKEY_CLASSES_ROOT\CLSID\{F91E5EE1-D220-43B5-90D1-A48E81C478B7}]
@="ComExample.Example"

[HKEY_CLASSES_ROOT\CLSID\{F91E5EE1-D220-43B5-90D1-A48E81C478B7}\InprocServer32]
@="mscoree.dll"
"ThreadingModel"="Both"
"Class"="ComExample.Example"
"Assembly"="COMInteropTesting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8568e57f6b170d6c"
"RuntimeVersion"="v2.0.50727"

[HKEY_CLASSES_ROOT\CLSID\{F91E5EE1-D220-43B5-90D1-A48E81C478B7}\InprocServer32\1.0.0.0]
"Class"="ComExample.Example"
"Assembly"="COMInteropTesting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8568e57f6b170d6c"
"RuntimeVersion"="v2.0.50727"

[HKEY_CLASSES_ROOT\CLSID\{F91E5EE1-D220-43B5-90D1-A48E81C478B7}\ProgId]
@="ComExample.Example"

[HKEY_CLASSES_ROOT\CLSID\{F91E5EE1-D220-43B5-90D1-A48E81C478B7}\Implemented Categories\{62C8FE65-4EBB-45E7-B440-6E39B2CDBF29}]

I’m no COM wizard of any measure but the registration looks valid to me. However, nothing seems to appear in the registry when running regasm on the assembly.

So my question is whether I’m missing something in my simple example to have the registration work, am I seeing false indications and is the registration actually correct and how can I better determine if the COM registration actually works

EDIT:
Using the alterations suggested by Kev I could not avoid the warnings from VS2008 but I could actually get something registered in the registry using regasm directly (nothing in the registry from just the VS2008 integration).

I then tried to remove the simple class so I had an empty assembly. Running regasm on this did not report any sort of warnings, only “Types registered successfully”. I see warnings like “RegAsm : warning RA0000 : No types were registered” when running RegAsm on some of my other assemblies which may be incorrectly exposed to COM. What is going on here, can I trust anything except the registry and what about the on/off warnings from regasm?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T18:51:05+00:00Added an answer on May 12, 2026 at 6:51 pm

    I created a class library project based on your code as follows:

    In the project properties page, select the Signing tab. Check the ‘Sign the assembly’ checkbox and select <New...> from the ‘Choose a strong name key file:’ drop down box.

    I then added the following class (Example.cs):

    [Guid("77699130-7D58-4d29-BE18-385871B000D1")]
    [InterfaceType(ComInterfaceType.InterfaceIsDual)]
    [ComVisible(true)]
    public interface IExample
    {
        [DispId(1)]
        string GetText();
    
        [DispId(2)]
        void SetText(string text);
    }
    
    [Guid("F91E5EE1-D220-43b5-90D1-A48E81C478B7")]
    [ClassInterface(ClassInterfaceType.None)]
    [ComVisible(true)]
    public class Example : IExample
    {
        private string m_text = "default text";
    
        [ComVisible(true)]
        public string GetText()
        {
          return m_text;
        }
    
        [ComVisible(true)]
        public void SetText(string text)
        {
          m_text = text;
        }
    }
    

    I then built the project then dropped to a command line where the DLL was output from the build.

    To register:

    regasm.exe COMInteropTesting.dll /register /codebase /tlb

    If your component needs to be accessible to multiple applications:

    gacutil.exe -i COMInteropTesting.dll

    This all worked fine on Windows 2003 32bit, Windows 2008 32bit and Windows 7 64 bit.

    One gotcha though is that if you’re testing the component with say CScript on a 64 bit system, you need to run the correct CScript interpreter. If you registered the assembly using 32bit RegAsm.exe (at C:\Windows\Microsoft.NET\Framework\v2.0.50727) then you need to run the 32 bit CScript interpreter at c:\Windows\SysWOW64.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
This could be a duplicate question, but I have no idea what search terms
I've tracked down a weird MySQL problem to the two different ways I was

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.