Explain the difference between Managed and Unmanaged code in .NET?
Explain the difference between Managed and Unmanaged code in .NET?
In .NET, the distinction between managed and unmanaged code is fundamental and revolves around how the code is executed and managed by the runtime environment.
Managed code is executed by the Common Language Runtime (CLR), which is a core component of the .NET framework. When you write code in high-level languages such as C#, VB.NET, or F#, it is compiled into an Intermediate Language (IL), also known as Common Intermediate Language (CIL) or Microsoft Intermediate Language (MSIL). This IL code is then executed by the CLR, which provides several essential services:
Unmanaged code, on the other hand, is executed directly by the operating system. This type of code is typically written in languages like C or C++ and is compiled directly into native machine code. Key characteristics of unmanaged code include:
Đăng nhập để tham gia thảo luận cùng mọi người.
Chưa có bình luận nào
Hãy là người đầu tiên chia sẻ suy nghĩ của bạn.