Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Do not override object.Finalize. Instead, provide a destructor.
Use finalizer syntax to specify instructions to execute when your object is destroyed.
The following sample generates CS0249:
// CS0249.cs
class MyClass
{
protected override void Finalize() // CS0249
// try the following line instead
// ~MyClass()
{
}
public static void Main()
{
}
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.