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...
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
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
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.