Compiler Error CS0262
TOC
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Compiler Error CS0262 

Error Message

Partial declarations of 'type' have conflicting accessibility modifiers

This error occurs if a partial type has inconsistent modifiers such as public, private, protected, internal, or abstract. These modifiers must be consistent in all partial declarations for that type. For more information, see Partial Class Definitions (C# Programming Guide).

Example

The following sample generates CS0262:

// CS0262.cs
class A
{
    public partial class C  // CS0262
    {
    }
    private partial class C
    {
    }
}
Show:
© 2016 Microsoft