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

Please explain me what the project manager will ask in the interview.The interview is for senior position in .Net (5 years experience )

2498


What is viewbag title?

529


Give an example for authorization filters in an asp.net mvc application?

538


i want to take the fast track training on >net Frame work and work flows and share point could you tellme the good institutes for that cources

1579


Explain how you can implement Ajax in MVC?

549






What is the difference between renderaction and renderpartial?

617


Describe the .net framework architecture.

586


What is meant by bootstrap in mvc5?

642


What is meant by domain model?

543


What are the versions of .net framework?

537


What is entitycontainer? : Entity framework

583


What are the benefits of .net framework?

565


What is objectset? : Entity framework

551


what is more complex to implement property, methods or event? how can I define criteria to compare the difficulty of implementation between them? for example the number of methods wanted to implements property is 2 methods. how many methods I need it to implements events?

1693


explain how you can load related entities in ef (entity framework)?

544