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 54977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:18:18+00:00 2026-05-10T17:18:18+00:00

I have the following interface which I’m trying to make COM-visible. When I try

  • 0

I have the following interface which I’m trying to make COM-visible. When I try to generate the type-library it doesn’t like the fact that my implementation class derives from a generic-class.

Is it possible to use a generic class as a COM implementation class? (I know I could write a non-generic wrapper and export that to COM, but this adds another layer that I’d rather do without.)

[ComVisible(true)] public interface IMyClass {    ... }  [ComVisible(true), ComDefaultInterface(typeof(IMyClass))] [ClassInterface(ClassInterfaceType.None)] public class MyClass : BaseClass<IMyClass>, IMyClass {    ... }  

Error message:

Warning: Type library exporter encountered a type that derives  from a generic class and is not marked as  [ClassInterface(ClassInterfaceType.None)]. Class interfaces cannot be exposed for such types. Consider marking the type with  [ClassInterface(ClassInterfaceType.None)]  and exposing an explicit interface as the default interface to  COM using the ComDefaultInterface attribute.
  • 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. 2026-05-10T17:18:19+00:00Added an answer on May 10, 2026 at 5:18 pm

    Generic types and types that derive from a generic type cannot be exported. Set ComVisible(false) on your MyClass type. You’ll need to either create a non-generic class implementation or use the interface only.

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

Sidebar

Ask A Question

Stats

  • Questions 78k
  • Answers 78k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Another way to protect against this is to use a… May 11, 2026 at 3:57 pm
  • added an answer Does this article (Section: XML Schema validation using serialization of… May 11, 2026 at 3:57 pm
  • added an answer I think what you're looking for to get the count… May 11, 2026 at 3:57 pm

Related Questions

I have the following interface which I'm trying to make COM-visible. When I try
I have the following interface: internal interface IRelativeTo<T> where T : IObject { T
Say I have the following interface that I want to share between my server
I have the following Linq to SQL query, in which I'm trying to do
I have the following 3 classes Book Product SpecialOptions There are many Books, and

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.