Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Compiler Error CS0056
Collapse the table of content
Expand the table of content

Compiler Error CS0056

Inconsistent accessibility: return type 'type' is less accessible than operator 'operator'

A public construct must return a publicly accessible object.

The following sample generates CS0056:

// CS0056.cs
class ii
// try the following line instead
// public class ii
{
}

public class a
{
   public static implicit operator ii(a aa)   // CS0056
   {
      return new ii();
   }

   public static void Main()
   {
   }
}
Show:
© 2015 Microsoft