What is the difference between managed and unmanaged code?

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How we can call a javascript function on the change of a dropdown list in mvc?

576


What are the new features 3.5 framework against with the tool?

546


What is the difference between partial and renderpartial?

497


What is routeconfig.cs in mvc 4?

647


What is .net framework used for?

588






What is the use .glimpse in mvc?

599


Explain the .net framework.

539


what is scalar property?

613


What are the new enhancements done in default project template of asp.net mvc 4?

584


What you mean by routing in mvc?

575


What is Attribute Routing in ASP.Net MVC?

595


What is the difference between old ADO.NET and Entity framework coding techniques?

562


Explain unit test done by tester on development team?

533


How can we determine action invoked from HTTP GET or HTTP POST?

567


How does servicing work for the .net framework 3.0? If I install the .net framework 3.0, can I get service updates for the .net framework 2.0?

518