C# Inheritance & Intellisense : accessing base class methods

Posted on 2005-04-25
Last Modified: 2011-10-03

Does this just not work in C#?

I have a base class with a method, let's say BaseMethod.
Also a class that inherits from the base class, let's call it InheritClass with a method InheritClassMethod.

In another class, I instantiate the InheritClass, eg. InheritClass myInheritClass = new InheritClass();
The problem : when I type in a C# project : myInheritClass. *dot* the intellisense pops up. But intellisense shows only InheritClassMethod, but it doesn't show BaseMethod.


When I type myInheritClass.BaseMethod, the project compiles and runs with no errors. So it's just the intellisense that doesn't show this. In VB.Net intellisense does show this method BaseMethod.

Is there a solution to solve this in C#?
Question by:Droezel
    LVL 25

    Expert Comment


    I think that this is just down to your IDE (or, the intellisense utility which you're using); for some reason, it isn't recognising any inherited functionality. It is very strange that it is fine with VB .NET, but it's quite obvious that most IDEs use different systems for different languages, perhaps you're just unlucky that the C# systems' intellisense doesn't support inheritance.

    As you say, it compiles fine, so clearly the functionality is being inherited.

    What IDE/intellisense utility are you using?

    LVL 50

    Accepted Solution

    This seems to be a fairly common problem.

    Have you tried cleaning up the compile files and restarting the IDE?

    Build -> Clean Solution

    LVL 96

    Expert Comment

    by:Bob Learned
    What does the class code look like?


    Author Comment

    Cleaning up, recompile and restart works indeed. However the situation keeps comming back al the time. Guess C# intellisense is a bit buggy? Thanks

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
    Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now