intermediate-language

How and when does .NET actually compile code?

时光毁灭记忆、已成空白 提交于 2019-11-28 20:55:15
Let's say you write an app in C#, VB, anything with .NET When you hit build, does it really compile your code? I thought so until I started using redgates reflector on some of my assemblies and saw my code verbatim. I would have expected loops to be unrolled and another plethora of optimizations, instead nothing. So when does the compilation actually happen? I think when it is built, code become IL (Intermediary Language) and when execution occurs, it is loading in the CLR? Is it optimized during CLR only and never at build time? Jorge Córdoba When you compile in VS Your source code is