In .Net is the 'Staticness' of a public static variable limited to an AppDomain or the whole process?
Is one copy of a public static variable created for each AppDomain in a process or is it just one copy for the whole process? In other words if I change the value of a static variable from within one AppDomain, will it affect the value of the same static variable within another AppDomain in the same process? It is per application domain as proven by this example: public class Foo { public static string Bar { get; set; } } public class Test { public Test() { Console.WriteLine("Second AppDomain: {0}", Foo.Bar); } } class Program { static void Main() { // Set some value in the main appdomain Foo