Expand Minimize
This topic has not yet been rated - Rate this topic

Compiler Error CS0549

'function' is a new virtual member in sealed class 'class'

A sealed class cannot be used as a base class, and a virtual method has to be implemented in a derived class, which is a contradiction.

The following sample generates CS0549:

// CS0549.cs
sealed public class MyClass
{
   virtual public void TestMethod()   // CS0549
   // to resolve, remove virtual from method or sealed from class
   {
   }

   public static void Main()
   {
   }
}
Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.