Home » .Net

Differences between managed and un-managed code in .Net

Learn: What are the differences between managed and un-managed code in .Net? How you can write a managed code in .Net technology (using supported languages)?

In this post, we are going to learn the differences between managed and un-managed code in .Net and how we can identify which whether a code is managed or un-managed?

There are following point that clears the difference between managed and un-managed code:

  1. Managed code is the code which is executed by Common Language Runtime instead of operating system. While Un-managed code is the code which is executed directly by the operating system outside the Common Language Runtime environment.
  2. The managed code compiler first compiles the manage code to MSIL code, also known as CIL code. This MSIL code doesn’t depend on any machine configuration and we can execute it on different machines. The un-managed code is directly compiled to native or machine code which depends on the machine configuration.
  3. In managed code, execution of the code handled by CLR, CLR provides different services like garbage collection, exception handling, security support and type checking. Whereas in case of un-managed code allocation and de-allocation of memory and type safety to be taken care of by the software developer.
  4. If the un-managed code is not properly handled, it may result in memory holes or memory leaks.
  5. Examples of un-managed code are Win32 APIs and ActiveX components that are execute beyond the scope of common language runtime.





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.
Learn PCB Designing: PCB DESIGNING TUTORIAL




Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.