Let's say I have a C# Windows Class library in my solution and I build it in my VS2010 IDE. The output here in my bin directory is X.dll
1) X.dll does not contain MSIL at this stage but "compressed byte code".
Is this true?
2) This "compressed byte code" is converted to MSIL somehow.
When does this occur?
3) When X.dll is accessed the JIT compiler of CLR takes the portion of MSIL that it needs to convert and does so into machine code.
Am I good on this final part?
Can anybody help in filling in the gaps in my understanding here?
X.dll contains MSIL bytecode after you build it with Visual Studio. You can prove this by disassembling it with ildasm.
At some time between assembly loading and the actual execution of the code, the MSIL is translated to native code. I am not familiar with where exactly this is done, but I would suspect at assembly load.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With