Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions docs/csharp/language-reference/compiler-messages/cs0465.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
description: "Compiler Warning (level 1) CS0465"
title: "Compiler Warning (level 1) CS0465"
ms.date: 07/20/2015
ms.date: 08/24/2026
ai-usage: ai-assisted
f1_keywords:
- "CS0465"
helpviewer_keywords:
Expand All @@ -12,13 +13,13 @@ ms.assetid: 3d36faae-147f-4173-b164-af953fd86eea

Introducing a 'Finalize' method can interfere with destructor invocation. Did you intend to declare a destructor?

This warning occurs when you create a class with a method whose signature is `public virtual void Finalize`.
The compiler issues this warning when you declare a method with the signature `void Finalize()`.
Comment thread
adegeo marked this conversation as resolved.

If such a class is used as a base class and if the deriving class defines a finalizer, the finalizer will override the base class `Finalize` method, not <xref:System.Object.Finalize*>.
A method named `Finalize` can interfere with finalizer invocation. To define a finalizer, declare `~TypeName()` instead of a `Finalize` method. For more information, see [Finalizers](../../programming-guide/classes-and-structs/finalizers.md).

## Example

The following sample generates CS0465.
The following sample generates CS0465.

```csharp
// CS0465.cs
Expand Down
Loading