3

What is difference between managed code and unmanaged code in terms of the .NET framework?

Daniel Vassallo
  • 337,827
  • 72
  • 505
  • 443
DotNetBeginner
  • 1,187
  • 1
  • 12
  • 17
  • Possible duplicate of [What is managed/unmanaged code in C#?](https://stackoverflow.com/questions/334326/what-is-managed-unmanaged-code-in-c) – T.Todua Nov 29 '18 at 21:54

3 Answers3

8

Managed code is a differentiation created by Microsoft to identify code that requires and will only execute under the "management" of a CLR virtual machine, resulting in Bytecode.

Benefits of using managed code include programmer convenience (by increasing the level of abstraction, creating smaller models) and enhanced security guarantees, depending on the platform (including the VM implementation).

From: Wikipedia: Managed Code

Daniel Vassallo
  • 337,827
  • 72
  • 505
  • 443
2

Generally it will refer to memory management.

the unsafe keyword will get you there (unmanaged): http://msdn.microsoft.com/en-us/library/aa288474%28VS.71%29.aspx

As will calling some external functions (extern keyword).

Noon Silk
  • 54,084
  • 6
  • 88
  • 105
0

Easily answered by Google and Microsoft: http://blogs.msdn.com/brada/archive/2004/01/09/48925.aspx

Daniel Vassallo
  • 337,827
  • 72
  • 505
  • 443
Kristian Hebert
  • 357
  • 1
  • 13