Compiler Error CS0267
The partial modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.
The placement of the partial modifier was incorrect in the declaration of the class, record, struct, interface, or method. To fix the error, reorder the modifiers. For more information, see Partial Classes and Methods.
The following sample generates CS0267:
public partial class MyClass
{
}
partial public class MyClass // CS0267
// Try this line instead:
// public partial class MyClass
{
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for