NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Compiler Error CS0051

Inconsistent accessibility: parameter type 'type' is less accessible than method 'method'

Public constructs need to use public objects.

The following sample generates CS0051:

class A {
// try the following line instead
// public class A {
   public static implicit operator A(int i) {return null;}
}

class B {
// try the following line instead
// public class B {
   public static implicit operator B(int i) {return null;}
}

public class C {
   public void f (A a) {
   }

   public void f (B b) {
   }

   public static void Main () {
      C c = new C();
      c.f((A)5);     // CS0051, could convert either to A or B
   }
}