description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||
---|---|---|---|---|---|---|---|
Compiler Error CS0756 |
Compiler Error CS0756 |
10/02/2023 |
|
|
847b20b0-bbf0-43a2-8728-4b54cb3d9cd6 |
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.
The following sample generates CS0756:
// CS0756.cs (5,18)
public partial class PartialClass
{
partial void PartialMethod();
partial void PartialMethod();
}
Remove all except one defining declaration for the partial method:
public partial class PartialClass
{
partial void PartialMethod();
}