As far as I know, codes written in any .NET language can not be executed without CLR.
Please take this code
public static void Main(string[] args) { var builder = WebApplication.CreateBuilder(args); builder.Services.AddControllersWithViews(); using var app = builder.Build(); app.UseStaticFiles(); app.UseRouting(); app.UseEndpoints(endpoints => { endpoints.MapDefaultControllerRoute(); }); app.Run(); }
The documentation says CreateBuilder adds an IServer instance by calling the UseIIS method to boot the CoreCLR and host the app inside of the IIS worker process (w3wp.exe or iisexpress.exe).
w3wp.exe
iisexpress.exe
I can not understand a bit how the CLR can be started from the Main() method. Then Who is converting this Main() IL to machine code?
Or am I missing something?