I'm sure this is simple but I can't find an explanation.
When disassembling .net with ILSpy or ILDASM there is a class named <module>
in the default namespace.
Why and how the compiler puts it there? I have this:
using abc;
using System;
internal class <Module>
{
static <Module>()
{
AssemblyLoader.Attach();
}
}
internal interface ISomething
{
}
This is not the standart declaration. If I'm recreating C# project how would I add that?
Also the way I see it it is in a static constructor and will get executed before the entrypoint, so if I put AssemblyLoader.Attach();
in my Main() or in a static constructor of Program
(I'm using console app template) this should do the trick, right?