Why can't I reference a static member from an inner class in C# ?
- by asksuperuser
I have a static class
namespace MyNameSpace{
public static class MyStaticClass {
public static string myStaticMember = "";
}
}
I can reference myStaticMember in another class like this:
string varString = MyStaticClass.myStaticMember;
except if MyStaticClass is an inner class of the other class.
Why ?