How C# source code is compiled? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 9

How C# source code is compiled?

14th May 2019, 9:33 AM
Ytbarek Gebre
Ytbarek Gebre - avatar
6 Answers
+ 8
C# source code is compiled in thefollowing steps: 1. First, the code is compiled into Microsoft Intermediate Language 2. When the app executes, another compiler(just-in time compiler) in the CLR translates the MSIL in into machine-language code (for a particular platform) 3. The machine-language code executes on that platform
14th May 2019, 10:10 AM
Ytbani
+ 7
Compiled into an intermediate language (IL) like byte code which in turn is interpreted or JIT compiled by a Common Language Runtime into native machine code for execution.
14th May 2019, 9:55 AM
Sonic
Sonic - avatar
+ 3
Using C# compiler to generate native code 🤔
14th May 2019, 12:13 PM
Sanjay Kamath
Sanjay Kamath - avatar
+ 1
JIT (just in time) or AOT (ahead of time) - both is possible.
14th May 2019, 11:06 AM
Daniel Adam
Daniel Adam - avatar
+ 1
1.your code is compile by c# compiler and it convert into MSIL(Microsoft intermediate language). 2.Then this compiled code is go in CLR(common language runtime) which provide all types of namespace and frameworks to your compiled programme.in CLR there is JIT(just in time compiler) which again recompile your code into machine code and show you result. The main advantage of MSIL is that you can transfer this MSIL to other persons or friend something so they can compile this code again with the help of JIT. Mainly when you share your programme with the other which is written in c# we share our MSIL code.
14th May 2019, 2:42 PM
Maninder $ingh
Maninder $ingh - avatar
0
Depends on the compiler and its configuration, for example: 1. In DotNet core, it will get converted to intermediate language code and will be JIT compiled for the required platform runtime, 2. Also, you get the option to publish it directly to machine code for a particular platform. 3. In case of Unity3D C# compiler, the code gets converted to C++ code and then compiled to machine code(IL2CPP) So, it depends on the compiler you use and the configration you use it in.
18th May 2019, 5:50 PM
Yash Kaushal
Yash Kaushal - avatar