.NET: What You Need to Know

A beautiful thing about .NET is that, from a programmer's perspective, you scarcely need to know anything about it to write programs for the .NET environment. You write a program in a high-level language, a compiler creates an executable (.EXE) file, and you run that EXE file. We show you exactly how to do that in just a few pages. Naturally, as the scope of what you want to do expands, you will need to know more, but to get started you need to know very little.

Even very simple programs, if they perform any input or output, generally require the use of the services found in library code. A large library, called the .NET Framework Class Library, comes with .NET, and you can use all of the services of this library in your programs.

What is really happening in a .NET program is somewhat elaborate. The EXE file that is created does not contain executable code, but rather Intermediate Language, or IL, code (sometimes called Microsoft Intermediate Language, or MSIL). In the Windows environment, this IL code is packaged up in a standard portable executable (PE) file format, so you will see the familiar EXE extension (or, if you are building a component, the DLL extension). When you run the EXE, a special runtime environment (the CLR) is launched, and the IL instructions are executed by the CLR. Unlike some runtimes, where the IL would be interpreted each time it is executed, the CLR comes with a just-in-time (JIT) compiler, which translates the IL to native machine code the first time it is encountered. Then, on subsequent calls, the code segment runs as native code.

Thus, in a nutshell, the process of programming in the .NET environment is:

1.
Write your program in a high-level .NET language.

2.
Compile your program into IL.

3.
Run your IL program, which will launch the CLR to execute your IL, using its JIT to translate your program to native code as it executes.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.202.54