Bug ? Class '[class name]' must either be declared 'MustInherit' or override the following i

I use CodeDom classes and VBCodeProvider to generate code and create assemblies. After the upgrade to Visual Studio 2005 Beta 2, I started getting the following error.

Class '[class name]' must either be declared 'MustInherit' or override the following inherited 'MustOverride' member(s):

Note that there is no member name following the error message.

If I create a project and add the generated files to the project, it compiles fine. Is this a possible bug?

Please help.
Thanks...

[517 byte] By [santamonicali] at [2007-12-16]
# 1

Could you test this on the Visual Studio 2005 RTM and post a bug on Microsoft Product Feedback Center if you are still experiencing this?

DavidM.Kean at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2

I originally had 12 projects in my solution... the bottom 4 projects (the root 4 projects) have been completed for some time.

We removed the 4 "Root" projects.... compiled them and placed them in a directory and the GAC on our development machines. However... one class (still in our solution of 8 projects) has this error:

--

Class 'Address' must either be declared 'MustInherit' or override the following inherited 'MustOverride' member(s):

even though it already overrides those members!?

what am I doing wrong... all I did is removed those root classes and placed the compiled assemblies in the GAC (and of course changed the reference of the class with the errors)

any help would be awesome!

thanks, ward0093

ward0093 at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 3

O.K.... here is what i have but can not explain

Three Classes - Two assemblies

Class1 & Class2 in Assem1

Class3 in Assem2

Class3 <-- inherits Class2 <-- inherts Class1 and Class1 & Class2 are marked as "MustInherit"

o.k.?

in Class1 we have a function call: [protected mustoverride function XYZ() as boolean]

in Class2 we have a function call: [protected mustoverride overrides XYZ() as boolean]

O.k.... now in our Class3 (the sub-class of them all) overrides XYZ.... and while both assemblies are in the same solution and compiled together... it all works fine!

however... if we compile Assem1 (with Class1 & Class2) and stick it in the GAC... now we get any error in Class3 saying we need to Override the function XYZ even though it already does!

I think this is a BIG BUG in the Compilier or Debug of the VS 2005 IDE? Can anyone chime in on this?

ward0093

ward0093 at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 4

I have just started experiencing the same thing with one of my classes. Has there been any resolution on this issue?

Thanks

DexIT at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 5
I'm now having the same problem as well. I've started with a class derived from UserControl and marked as MustInherit, called BaseUserControl. I then have another derived from BaseUserControl that is also marked as MustInherit, called DerivedUserControl.

In BaseUserControl I have several properties marked as MustOverride. In DerivedUserControl I mark those same property with both MustOverride and Overrides.

When I create user controls I can derive from BaseUserControl without issue, but when deriving from DerivedUserControl, I get the same error.

I've got Visual Studio SP1 installed as well.

Matt7340 at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic General...