C#: determine if a class has already been initialized
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box; 2 0 I have many classes in an assembly that I can't or don't want to modify. At some point of runtime, I want to know which of them have already been "initialized": static initializer (= static constructor) has run. Is there a way to do it with reflection or something else? For information, not every class in an assembly is initialized when the assembly is loaded. This can be easily observed with this piece of code: public static class Foo static Foo() MainClass.Value = "Something"; public static void DoSomething() Thread.Sleep(100); public static class MainClass public static string Value = "Nothing"; public static void Main() Console.WriteLine(Value); Foo.DoSomething(); Console.WriteLine(Value); Displays: Nothing Something c# reflection share | improve ...