2

In a multi-project solution, I am converting some of the projects from .NET Framework (4.6.2) to .NET Standard (2.0). I have an abstract class in the converted .NET Standard project that defines (for example)

Public MustOverride Function DoStuff(input As IEnumerable(Of Integer));

and an implementation in one of the unconverted .NET Framework projects

Public Overrides Function DoStuff(input As IEnumerable(Of Integer))
{
    //Does stuff
}

After conversion, I have a build error

Function 'DoStuff' cannot be declared 'Overrides' because it does not override a function in a base class.

There are many overridden methods in this class - the only ones that fail are the ones that have an IEnumerable parameter. Visual Studio shows me that the IEnumerable definition for the .NET Standard project is in netstandard 2.0.0.0, while the definition for the Framework project is in mscorlib 4.0.0.0. Shouldn't this still work, as .NET Framework 4.6.2 supports .NET Standard 2.0? Is there a way I can ensure that both classes find the same IEnumerable? I have tried referencing NETStandard.Library in the Framework project, with no effect.

Blackwood
  • 4,504
  • 16
  • 32
  • 41

0 Answers0