What is the difference between managed and unmanaged code?

Answer Posted / charles

Code that is executed by the CLR. Managed code provides
information (i.e., metadata) to allow the CLR to locate
methods encoded in assembly modules, store and retrieve
security information, handle exceptions, and walk the
program stack. Managed code can access both managed data
and unmanaged data. Managed data—Memory that is allocated
and released by the CLR using Garbage Collection. Managed
data can only be accessed by managed code


2.Code that targets the common language runtime, the
foundation of the .NET Framework, is known as managed code;
code that does not target the common language runtime is
known as unmanaged code. You can think of the runtime as an
agent that manages code at execution time, providing core
services such as memory management, thread management, and
remoting, while also enforcing strict type safety in the
code. The concept of code management is a fundamental
principle of the runtime.

3.Managed code supplies the metadata necessary for the CLR
to provide services such as memory management, cross-
language integration, code access security, and automatic
lifetime control of objects. All code based on IL executes
as managed code.

4.Code that executes under the CLI execution environment.
Managed code uses the execution environment for memory
management, object lifetime, and the basic type-system,
among other fundamental services.

Is This Answer Correct ?    25 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does work clr?

527


What is the use of the default route?

599


What happens when I install the .net framework 3.0? How can I upgrade if I already have the .net framework 2.0 installed?

525


How do you specify comments using razor syntax?

596


Is it possible to create a custom filter?

561






What is separation of concerns in asp.net mvc?

593


How to use Jquery Plugins in ASP.Net MVC validation?

544


What is entity framework used for?

518


What is entitycontainer? : Entity framework

577


What are the main components of .net framework?

542


What is objectcontext? : Entity framework

585


What is entity sql? : Entity framework

559


Is it possible to combine asp.net webforms and asp.mvc and develop a single web application?

541


What is .net framwork?

555


will there be any issues adding a table without primary keys to a data model?

602