C/C++的程序,其静态对象的初始化是在入口函数main调用之前执行的。
我想知道对于C#程序或者.net程序而言,这种初始化的时机和顺序,有没有相应的文档和标准来规定
msdn上面有没有明确的说法?
------解决思路----------------------
As is the case with all class types, the type information for a static class is loaded by the .NET Framework common language runtime (CLR) when the program that references the class is loaded. The program cannot specify exactly when the class is loaded. However, it is guaranteed to be loaded and to have its fields initialized and its static constructor called before the class is referenced for the first time in your program. A static constructor is only called one time, and a static class remains in memory for the lifetime of the application domain in which your program resides.