J
Jeff Brown
I understand that a static constructor is not called until and unless the
class is instantiated, or any of its static members are referenced.
But suppose (for the sake of argument) a class is neither instantiatable,
nor has any static members. For example:
static public class MyClass
{
static MyClass()
{
Console.WriteLine("Hooray, you did it!");
}
}
Is there any way on heaven or earth to get that static constructor to
execute? Through reflection or whatever?
Thanks for any help.
Jeff Brown
class is instantiated, or any of its static members are referenced.
But suppose (for the sake of argument) a class is neither instantiatable,
nor has any static members. For example:
static public class MyClass
{
static MyClass()
{
Console.WriteLine("Hooray, you did it!");
}
}
Is there any way on heaven or earth to get that static constructor to
execute? Through reflection or whatever?
Thanks for any help.
Jeff Brown