What is the difference between managed and unmanaged code?

Answers were Sorted based on User's Feedback



What is the difference between managed and unmanaged code?..

Answer / uppalashiva

A code that executed under the instructions of CLR is called
managed code.
A code that execute without the instruction of CLR is called
unmanaged code.

Is This Answer Correct ?    59 Yes 2 No

What is the difference between managed and unmanaged code?..

Answer / uppalashiva

A code which is understandable by CLR is called managed code
A code which is not understandable by CLR is called
unmanaged code

Is This Answer Correct ?    32 Yes 3 No

What is the difference between managed and unmanaged code?..

Answer / 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

What is the difference between managed and unmanaged code?..

Answer / rita patel

The code that targets the CLR is known as managed code.
and the code that doesn't targets the CLR is known as
unmanaged code.

unmanaged code is still executed by CLR but it doesn't get
advantages of CLR like memory management, thread managament,
security, garbage mechanism etc.

managed code executed on fixed location in memory while
unmanaged code executes on random location in memory.

Is This Answer Correct ?    6 Yes 0 No

What is the difference between managed and unmanaged code?..

Answer / sudhir singh

MANAGED CODE is what Visual Basic .NET and C# compilers create. It runs on the CLR (Common Language Runtime), which, among other things, offers services like garbage collection, run-time type checking, and reference checking. So, think of it as, "My code is managed by the CLR."

Visual Basic and C# can only produce managed code, so, if you're writing an application in one of those languages you are writing an application managed by the CLR. If you are writing an application in Visual C++ .NET you can produce managed code if you like, but it's optional.

UNMANAGED CODE compiles straight to machine code. So, by that definition all code compiled by traditional C/C++ compilers is 'unmanaged code'. Also, since it compiles to machine code and not an intermediate language it is non-portable.

Is This Answer Correct ?    1 Yes 0 No

What is the difference between managed and unmanaged code?..

Answer / suresh (agility)

Code written according to .NET specification i.e.,CLS(Common Language Specification) is called managed code.
Code written not according to .NET specification is called unmanaged code.

Is This Answer Correct ?    4 Yes 4 No

What is the difference between managed and unmanaged code?..

Answer / vikas

A Managed code is code which runs under the control of CLR.
All DOT Net Codes are Managed Codes
but
A Unmanaged code is code which does not run under the
control of CLR like COM Dlls developed in VB6

Is This Answer Correct ?    0 Yes 0 No

What is the difference between managed and unmanaged code?..

Answer / jonasstuart

Managed Code:
Code that runs under a "contract of cooperation" with the common language runtime. Managed code must supply the metadata necessary for the runtime to provide services such as memory management, cross-language integration, code access security, and
automatic lifetime control of objects.
Un-Managed Code:
Code that is created without regard for the conventions and requirements of the common language runtime. Unmanaged code executes in the common language runtime environment with minimal services.Check this useful article
https://www.mindstick.com/blog/833/difference-between-managed-code-and-unmanaged-code
http://www.agrini-tricks.in/Tutorial/Differentiate-between-managed-code-and-unmanaged-code.aspx
I hope it will help you

Is This Answer Correct ?    0 Yes 0 No

What is the difference between managed and unmanaged code?..

Answer / priya

codes that are executed in a clr environment is managed
code and the codes which are not executed in a clr env. is
called unmanaged code.

Is This Answer Correct ?    6 Yes 7 No

What is the difference between managed and unmanaged code?..

Answer / amit saini

Managed code is the code which run under the control of clr.
incontrast code that is native code which is machine
specific code and runs directly under the control of machine
or specific computer architecture is known as unmanaged
code...

Is This Answer Correct ?    2 Yes 6 No

Post New Answer

More Dot Net Framework Interview Questions

Explain what languages does the .net framework support?

0 Answers  


How does .net framework works?

0 Answers  


Is entity framework slow?

0 Answers  


What is the .net framework and how does it work?

0 Answers  


What is the difference between the value-type variables and reference-type variables in terms of garbage collection ?

1 Answers  






How do you do role based security ?

1 Answers   Accenture, BirlaSoft,


what is .edmx file and what it contains?

0 Answers   Microsoft,


What are ajax helpers in mvc?

0 Answers  


What are the features that are new in .net 2.0

2 Answers   Emphasis,


What are action filters?

0 Answers  


Can you explain renderbody and renderpage in asp.net mvc?

0 Answers  


what is a mvc in asp.net?

3 Answers   Cap Gemini, Elsinoir Technologies, HCL,


Categories