Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 1.07 KB

cs0756.md

File metadata and controls

44 lines (33 loc) · 1.07 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Compiler Error CS0756
Compiler Error CS0756
10/02/2023
CS0756
CS0756
847b20b0-bbf0-43a2-8728-4b54cb3d9cd6

Compiler Error CS0756

A partial method may not have multiple defining declarations.

The defining declaration of a partial method is the part that specifies the method signature, but not the implementation (method body). A partial method must have exactly one defining declaration for each unique signature. Each overloaded version of a partial method must have its own defining declaration.

Example

The following sample generates CS0756:

// CS0756.cs (5,18)

public partial class PartialClass
{
    partial void PartialMethod();
    partial void PartialMethod();
}

To correct this error

Remove all except one defining declaration for the partial method:

public partial class PartialClass
{
    partial void PartialMethod();
}

See also