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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:23:21+00:00 2026-05-13T00:23:21+00:00

When reflecting on an interface type, I only get the members of the specific

  • 0

When reflecting on an interface type, I only get the members of the specific type, not inherited members.

In this over-simplified example, the program only prints “Name”, not “ItemNumber”, “Name” as I would expect:

using System;

public interface IBasicItem
{
    string ItemNumber { get; set; }
}

public interface IItem : IBasicItem
{
    string Name { get; set; }
}

class Program
{
    static void Main(string[] args)
    {
        var type = typeof (IItem);
        foreach (var prop in type.GetProperties())
            Console.WriteLine(prop.Name);
    }
}

What is the rationale behind this ? When I am inheriting from the base interface, I am saying that any of the implementations of my interface, must also implement the inherited members. In other words, IItem is-a IBasicItem. So why does the inherited member not show up using reflection ?

  • 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-13T00:23:22+00:00Added an answer on May 13, 2026 at 12:23 am

    I think this is exactly what Phil Haack just blogged about.

    From the ECMA-335 Common Language Infrastructure specification:

    8.9.11 Interface type derivation Interface types can require the
    implementation of one or more other
    interfaces. Any type that implements
    support for an interface type shall
    also implement support for any
    required interfaces specified by that
    interface. This is different from
    object type inheritance in two ways:

    • Object types form a single inheritance tree; interface types do
      not.
    • Object type inheritance specifies how implementations are inherited;
      required interfaces do not, since
      interfaces do not define
      implementation. Required interfaces
      specify additional contracts that an
      implementing object type shall
      support.

    To highlight the last
    difference, consider an interface,
    IFoo, that has a single method. An
    interface, IBar, which derives from
    it, is requiring that any object type
    that supports IBar also support IFoo.
    It does not say anything about which
    methods IBar itself will have.

    Referenced from:
    http://haacked.com/archive/2009/11/10/interface-inheritance-esoterica.aspx

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

Sidebar

Ask A Question

Stats

  • Questions 236k
  • Answers 236k
  • 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
  • Editorial Team
    Editorial Team added an answer I believe the key settings you should look at are… May 13, 2026 at 6:18 am
  • Editorial Team
    Editorial Team added an answer I know this isn't what you want to hear, but… May 13, 2026 at 6:18 am
  • Editorial Team
    Editorial Team added an answer Streams have fclean available, which flushes the write buffer, and… May 13, 2026 at 6:18 am

Related Questions

I know some DI frameworks support this (e.g. Ninject ), but I specifically want
I have assembly A that depends (statically) on type T (reference type, a class)
Let me give a scenario then see if anyone has a solution / work-around.
I'm having some problems trying to figure out how to solve a problem without

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.