What is managed code in C #?
Analysis:
ManagedCode(Managed code) is actually an intermediate language (IL) code.
After the code is compiled, the compiler compiles the code into an intermediate language (IL) instead of a machine code that can run directly on your computer.
ProgramAn assembly file encapsulates the intermediate language. A program contains all metadata describing the created methods, classes, and attributes.
The managed code runs in the Common Language Runtime Library (CLR. This Runtime Library provides multiple services for Running code. Generally, the Common Language Runtime Library can load and verify the Assembly to ensure the correctness of the intermediate language.
When some methods are called, the Common Language Runtime Library compiles the specific methods into machine codes suitable for running on local computers and caches the compiled machine codes for use in the next call. This process is instant compilation.
Note: The program is actually "hosted" in the Public Language Runtime Library. As the Assembly runs, the Common Language Runtime Library continuously provides various services, such as memory management, security management, and thread management.
Summary:
Managed code is the code executed by the Common Language Runtime Library (CLR), rather than directly executed by the operating system.
Managed code can also call the CLR Runtime library services and functions, such as GC, type check, and security support. These services and functions provide independent and unified management code application behavior.