2

I understand that C# source code is converted to Common Intermediary Language that is executed by Common Language Runtime. It is just like Java source code that is converted to byte code that is executed by Java Virtual Machine.

My question is in the context of a Console Application in Visual Studio. Let's say I create a simple Hello World console application in Visual Studio.

console app

I then build the project ConsoleApp1. I understand building is compiling into assemblies like DLL or EXE. In this case I will get EXE as my Program.cs is a simple main function with Hello World printing.

I will then run the EXE in command prompt.

  1. Where is the Common Language Runtime in this process?
  2. Is it responsible for executing the assembly? But then did I not execute the EXE thru command prompt (meaning I just executed some native code as it is without help of CLR)?
Prasanjit Rath
  • 166
  • 2
  • 13
  • 1
    For .NET framework, this article may give you an imprerssion of this process: https://www.codeproject.com/Articles/808838/NET-Application-Boot-Strapping – Klaus Gütter Jul 13 '22 at 12:04
  • Look at References, you will see a reference to `mscorlib` or `System.Private.CoreLib`. No it doesn't execute the assembly, the Virtual Execution System does that, namely `mscoree`, that is what bootstraps everything else. See https://blog.birost.com/a?ID=01200-8af53ad6-56dc-4998-8f2b-56e428df2aa5 for example – Charlieface Jul 13 '22 at 13:05
  • The CLR is a runtime environment for .NET assemblies. It is similar to the Java Virtual Machine. The term VES comes from the CLI. – Housheng-MSFT Jul 19 '22 at 09:45

0 Answers0