Understanding .NET compilation

As far as I understand .NET concepts, the source code is first translated into an Assembly (IL code+meta data), which is compiled to machine code on the target machine with the CLR’s JIT compiler.
However I cannot really match these concepts to what I see when working on a C# project.
When I build a project I get an .exe file, which I assume is the executable machine code. Where is the IL stored? Can I access it and transfer it to a different platform e.g. to Linux?

To sum up, could somebody correct my understanding and explain the outputs?

>Solution :

There is no assembly code in .net assemblies.

.Net programs are converted to a .NET Assembly, which is an .exe or .dll that contains intermediate bytecode. See CIL

Visual Studio will place the .NET Assemblies in your project’s /bin or /bin/Release). You can change this path.

The dll or .exe are the assembled files which are generated inside the cited folders.

Both files can run on linux as long as the framework version is supported by the plataform.

Full .net framework is only for windows, but mono and core are being ported to linux.

https://docs.microsoft.com/en-us/dotnet/standard/assembly/

Leave a Reply