What is managed and unmanaged code?

The .NET framework provides several core run-time services to the programs that run within it – for example exception handling and security. For these services to work, the code must provide a minimum level of information to the runtime. i.e., code executing under the control of the CLR is called managed code. For example, any code written in C# or Visual Basic .NET is managed code. Code that runs outside the CLR is referred to as unmanaged code. COM components, ActiveX components, and Win32 API functions are examples of unmanaged code.
The .NET Framework provides a run-time environment called the Common Language Runtime, which manages the execution of code and provides services that make the development process easier. Compilers and tools expose the runtime’s functionality and enable you to write code that benefits from this managed execution environment. Code that you develop with a language compiler that targets the runtime is called managed code; it benefits from features such as cross-language integration, cross-language exception handling, enhanced security, versioning and deployment support, a simplified model for component interaction, and debugging and profiling services.

Tagged , . Bookmark the permalink.

2 Responses to What is managed and unmanaged code?

  1. Narayanan says:

    Nice Post

  2. greercund says:

    Nice post. I find out something even more difficult on numerous blogs everyday. It’ll constantly be stimulating to read content from other writers and practice a bit something from their store. I’d prefer to make use of some using the content on my blog no matter whether you don’t mind. Natually I’ll give you a link on your web blog. Thanks for sharing.

Leave a Reply