How to stop a static constructor(i.e. module constructor & type constructor) from running in .NET?
For example:
class A
{
static A()
{
Environment.Exit(0);
}
static int i()
{
return 100;
}
}
How to invoke i() without exiting?
If you use
The static ctor won’t run.