TL:DR - does not work as "entry" point, will be invoked before any other method in module, if no methods are invoked - no luck.
In order to test things, i checked some articles about "Module constructor C#" and found related content: http://einaregilsson.com/module-initializers-in-csharp/
Code below is "copy paste" with few additional lines.
In order to test how things will go, i "wrote" same loading 2 liner:
RimWorld invoke no debugging, just "asm.GetTypes ()" and this invocation will not trigger module cctor.
In order to test things, i checked some articles about "Module constructor C#" and found related content: http://einaregilsson.com/module-initializers-in-csharp/
Code below is "copy paste" with few additional lines.
Code Select
namespace Rimgazer
{
public static class module
{
public static void main()
{
Console.WriteLine(Environment.StackTrace);
Console.WriteLine("LOOKS LIKE MODULE CCTOR");
}
}
}
In order to test how things will go, i "wrote" same loading 2 liner:
Code Select
byte[] rawAssembly = File.ReadAllBytes("Rimgazer.dll");
Assembly asm = AppDomain.CurrentDomain.Load(rawAssembly);
Console.WriteLine (asm);
RuntimeHelpers.RunModuleConstructor (asm.GetModules ()[0].ModuleHandle);
Console.WriteLine ("BREAK");
asm.GetTypes ()[0].GetMethod ("main").Invoke (null, null);
RimWorld invoke no debugging, just "asm.GetTypes ()" and this invocation will not trigger module cctor.