Typically, each method is executed JITted because it is first executed, and assembly resolution is again performed as needed, which usually means “during the JIT method, which uses the assembly that we don’t need yet” (but can also mean: through reflection).
static Main , ; , Main, Main. ( ):
static int Main(string[] args) {
try {
return MainImpl(args);
} catch(Exception ex) {
return -1;
}
}
[MethodImpl(MethodImplOptions.NoInlining)]
static int MainImpl(string[] args) { ... }
, , Main ( MainImpl), ... catch - Main, Main .
...
share