Compiler Error CS0267

The partial modifier can only appear immediately before 'class', 'struct', or 'interface'

The placement of the partial modifier was incorrect in the declaration of the class, struct or interface. To fix the error, reorder the modifiers. For more information, see Partial Classes and Methods (C# Programming Guide).

The following sample generates CS0267:

// CS0267.cs
public partial class MyClass
{
   public MyClass()
   {
   }
}

partial public class MyClass  // CS0267
// Try this line instead:
// public partial class MyClass
{
   public void Example()
   {
   }

   public static void Main()
   {
   }
}