Compiler Error CS0261
Partial declarations of 'type' must be all classes, all structs, or all interfaces
This error occurs if a partial type is declared as a different type of construct in various places. For more information, see Partial Classes and Methods.
The following sample generates CS0261:
// CS0261.cs
partial class A // CS0261 – A declared as a class here, but as a struct below
{
}
partial struct A
{
}
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