What is a managed and unmanaged code?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Muhammad Imran AnsariRank #326 · 7.6K reputationPosted Nov 18, 2023, 4:53 AM EST
In the context of C# and the .NET framework, "managed code" refers to code that is executed by the Common Language Runtime (CLR), which is part of the .NET framework. The CLR provides services such as automatic memory management (garbage collection), type checking, and exception handling. C# is considered a managed language because it is designed to run within the .NET runtime environment.
On the other hand, "unmanaged code" refers to code that is not executed by the CLR and does not take advantage of the services provided by the .NET framework. Unmanaged code typically interacts directly with the operating system and is responsible for managing its own memory, type safety, and other runtime behaviors.
Further, you can read the below article:
https://www.c-sharpcorner.com/uploadfile/puranindia/managed-code-and-unmanaged-code-in-net/