What do the CLR and managed code do in .NET?
Interactive Practice Mode
Formulate your thoughts or take notes before revealing the model solution.
Saved automatically
Model Answer & Deep-Dive Explanation
Managed code executes under .NET runtime services such as type handling, exception processing, and garbage collection. In common execution paths, language compilers produce intermediate language that the runtime compiles to machine code, although ahead-of-time compilation is also available. The CLR is the runtime associated with these execution services. Managed does not mean free of resource leaks or security defects; applications can retain unwanted objects or misuse native resources. Distinguish the runtime, libraries, language, and SDK when discussing what a .NET application requires.