This topic has not yet been rated - Rate this topic

Compiler Error CS0249

Do not override object.Finalize. Instead, provide a destructor.

Use destructor syntax to specify instructions to execute when your object is destroyed.

For more information, see Destructor Syntax in C# and C++.

The following sample generates CS0249:

// CS0249.cs
class MyClass
{
   protected override void Finalize()   // CS0249
   // try the following line instead
   // ~MyClass()
   {
   }

   public static void Main()
   {
   }
}
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ