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

What is the use of view model in asp.net mvc?

689


Do I need microsoft .net framework?

566


What is web api‘s in asp.net mvc 4 ?

601


Define the core components of an ASP.NET MVC application?

585


Is .net core replacing .net framework?

481






Will the name change be reflected in any of the existing .net framework 2.0 apis, assemblies, or namespaces?

555


What is the full form of sp?

503


Briefly describe the roles of clr in .net framework?

559


What is the greatest advantage of using asp.net mvc over asp.net webforms?

569


What is object service? : Entity framework

645


Why to use html.partial in mvc?

725


Why to use '{resource}.axd/{*pathInfo}' in routing in ASP.Net MVC?

2071


What are the components required to create a route in ASP.Net MVC?

599


how do you truncate a table using entity data model?

595


what is client wins and store wins mode in entity framework concurrency?

660