• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 454
  • Last Modified:

C# Inheritance & Intellisense : accessing base class methods


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#?
1 Solution

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?

Julian HansenCommented:
This seems to be a fairly common problem.

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

Build -> Clean Solution

Bob LearnedCommented:
What does the class code look like?

DroezelAuthor Commented:
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now