I have already learned about hosting.CodeThe concept of managed code is to be learned now.
On the Donnet platformProgramming LanguageAs long as the compiler is oriented to CLR, it can work. However, different languages have different advantages, so you should select the language that best expresses your intention.
For example, no matter which language or compiler is used, the result is to generate a managed module, which is a standard 32-bit Microsoft Windows portable execution body (pe32) file, or a standard 64-bit Microsoft Windows Executable (pe32 +) file, which consists of pe32 or pe32 + headers, CLR headers, metadata, and intermediate languages, it must be managed by CLR, so it is called a managed module.
What is a PE file? PE means portable executable, which is a portable executable file in Microsoft Windows, here is an explanation of its structure: http://www.cnblogs.com/ilove/archive/2008/04/15/1157228.html. In the managed module, the pe32 or pe32 + header is the standard Windows PE File Header. If this header is in the pe32 format, the file can be run in the Windows 32-bit or 64-bit version, if it is pe32 +, it can only run on 64-bit.
The CLR header contains information that makes this module A managed module (consists of the CLR header and Program Contains the required CLR version, some labels, and methoddef metadata tag of the managed module entry method (main method, the metadata of the module, resources, strong names, some signs, and the size and location of other less important data items.
Metadata (metadata) is a special data table of the system. It mainly has two types of tables, one is used to describe Source code Types and Members defined in. One is the type that describes Source code references.
Intermediate Language: the code generated by the compiler compilation is called the intermediate language. CLR compiles the Il command at a cost. Il is stack-based, which means that all its commands will press the operand into an execution stack, and the result will pop up from this stack. Since il does not provide instructions for operation registers, compiler developers can easily generate il code. They don't have to worry about register management, and require less il commands, because there are no commands specifically used to operate registers. Il commands are still "non-typed". The biggest advantage of Il is not that it is an abstraction from the underlying CPU, but that it provides application reliability and security.
The interaction between managed code and non-managed code includes the following:
(1) The managed code can call an unmanaged function in the DLL.
(2) managed code can use an existing COM Component
(3) unmanaged code can use a managed type