The namespace N with classes P and I are here: The class A is here: Here are the answers to the questions: If class A and the classes in the namespace N are compiled together, to a single
assembly, all the visibility problems vanish. This compilation can be done with:namespace N{
public class P{
internal static int i = 5;
public static int p = 6;
private I anI;
}
internal class I{
internal static int i = P.i;
public static int p = P.p;
}
}
using N;
class A {
public static void M(){
P aP;
// I aI; // Not accessible
// int x = P.i; // Not visible outside x.dll
int y = P.p;
// int z = I.i; // Not visible outside x.dll
// int w = I.p; // Not visible outside x.dll
}
}
csc /t:library /out:y.dll n.cs aa.cs