none
meaning RRS feed

  • Question

  • Hi,
    what is the meaning of this

    "Code that targets the runtime is known as managed code"
    Life is unpredictable! Do right things and be safe!
    Tuesday, March 2, 2010 6:38 AM

Answers

  • in .net CLS alllows you write code in multiple .net supported languages but when you compile it it genrates common MSIL (intermediate languages) which depends on runtime CLR to execute in binary. this code is called managedcode, managed code enjoys all the feature provided by CLR like garbage collection, exception handling, memory management, type safety etc.

    while unmanaged code like COM+ object can be used in c# which requires explicit handling in terms of type safety, memory management and garbage collection.
    Manish Sati
    Tuesday, March 2, 2010 7:13 AM
  • As per the ECMA specification managed is the term used for the code and langauge which can run in context of .NET CLR.

    This is why we have Managed and Un-managed languages and features.

    Any code which is not understandable by the .NET CLR will be considered unsafe or unmanaged.

    C++, VC++, pointers etc are some common examples of unmanaged languages and unsafe feature implementation.

    This is why C# offers code construct named unsafe { }  to embeed pointer specific code in it.

    Hope this helps.
    Vidya Vrat Agarwal. MCPD,MCTS, MCT, MCSD .NET, MCAD .NET, MCSD. http://dotnetpassion.blogspot,com
    Tuesday, March 2, 2010 9:54 PM

All replies

  • in .net CLS alllows you write code in multiple .net supported languages but when you compile it it genrates common MSIL (intermediate languages) which depends on runtime CLR to execute in binary. this code is called managedcode, managed code enjoys all the feature provided by CLR like garbage collection, exception handling, memory management, type safety etc.

    while unmanaged code like COM+ object can be used in c# which requires explicit handling in terms of type safety, memory management and garbage collection.
    Manish Sati
    Tuesday, March 2, 2010 7:13 AM
  • As per the ECMA specification managed is the term used for the code and langauge which can run in context of .NET CLR.

    This is why we have Managed and Un-managed languages and features.

    Any code which is not understandable by the .NET CLR will be considered unsafe or unmanaged.

    C++, VC++, pointers etc are some common examples of unmanaged languages and unsafe feature implementation.

    This is why C# offers code construct named unsafe { }  to embeed pointer specific code in it.

    Hope this helps.
    Vidya Vrat Agarwal. MCPD,MCTS, MCT, MCSD .NET, MCAD .NET, MCSD. http://dotnetpassion.blogspot,com
    Tuesday, March 2, 2010 9:54 PM