Can anyone explain the difference between unmanaged code and managed code?


This is not a SharePoint question, but anyways, here's a real quick intro:

Unmanaged code: This is code that is compiled directly to machine code using native languages (C++, VB etc). The reason it is called unmanaged code is that your application is responsible for resource management (memory, handles etc). This is typically what we call a Win32 application.

Managed code: Managed code are code compiled to an intermediate byte code, which (normally) during runtime are JIT (Just In Time) compiled into machine code. The reason it is called managed code is that it has built-in functionality for memory management and garbage collection. This is what the Microsoft .NET Framework is (or Java for that matter).

  • Thanks. I can now relate this with sand box solution (which does not allow to run unmanaged code.)
    – Regmi
    Sep 23 '11 at 5:56
  • +1 for being meta expressive :D Sep 23 '11 at 10:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.