Export (0) Print
Expand All
Expand Minimize

Compiler Error CS0757

Visual Studio 2008

A partial method may not have multiple implementing declarations.

A partial method consists of exactly one defining declaration (signature) and one or zero implementing declarations (body). Multiple implementing declarations for the same identical defining declarations are not allowed. Partial methods may be overloaded, and each overloaded version may have one or zero implementing declarations.

To correct this error

  • Remove all except one of the implementing declarations for the partial method.

The following example generates CS0757:

// cs0757.cs
using System;

    public partial class C
        // Defining declaration.
        partial void Part();

        // Implementing declaration.
        partial void Part()
            //...Do something.

        // Second implementing declaration.
        partial void Part() // CS0757
            //...Do something.

        public static int Main()
            return 1;

Community Additions

© 2015 Microsoft