Link to home
Start Free TrialLog in
Avatar of Droezel
Droezel

asked on

C# Inheritance & Intellisense : accessing base class methods

Hi,

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.

Why?

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#?
Avatar of InteractiveMind
InteractiveMind
Flag of United Kingdom of Great Britain and Northern Ireland image

Hello,

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?

Regards;
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What does the class code look like?

Bob
Avatar of Droezel
Droezel

ASKER

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