Compiler Error CS0260
Missing partial modifier on declaration of type 'type'; another partial declaration of this type exists
This error indicates that you have declared multiple classes that have the same name. In addition, at least one but not all of the declarations contains the partial
modifier. If you want to define a class in several parts, you must declare each part by using the keyword partial
.
This error also occurs if you declare a class and accidentally give it the same name as a partial class that's declared elsewhere in the same namespace.
The following sample generates CS0260:
// CS0260.cs
// You must mark both parts of the definition of class C
// by using the partial keyword.
// The following line causes CS0260. To resolve the error, add
// the 'partial' keyword to the declaration.
class C
{
}
partial class C
{
}
See also
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