Click here to Skip to main content
15,886,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an exe file named Addition.exe which will prompt user to enter two numbers and it will display the sum.
Once the developer developed the code he will build the code with the respective language compiler compiled it to IL.
My doubt here is
1)does the exe file contains this IL code or will it contains the code after the CLR i.e. Native code?

Now, The user is having this exe file and he executed the program
2) if this exe is having IL code , from where the CLR will be available in this machine to run the program as the user didn't install any .net related software and his OS may be Linux, Windows etc
3)if this exe is having native code, this shouldn't be the case at all, as if it is native code it won't run at all

What I have tried:

I tried by reading some articles
Posted
Updated 1-Jun-18 7:40am

1 solution

The .EXE has the IL in it. There is a normal "header" in the executable that loads the .NET CLR. The application code is not compiled to native CPU code.

The .NET CLR JIT compiler will load the IL code, compile it to native code for the CPU it's running on, cache that native code, then the CPU will execute that.

If the machine running the application does not have the appropriate .NET Framework installed on it, the application will NOT run.

The .NET Framework 1.0 through 4.7.2 is for Windows only. It will not work on other platforms.

For a cross-platform app that you can run on Windows, Linux, and Mac, you would have to build the application using .NET Core 2. or better. There is still a runtime that has to be installed to run the app. See Get started with .NET Core | Microsoft Docs[^] for more information.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900