Managed code is code written in one of over twenty high-level programming languages that are available for use with the Microsoft .NET Framework, including C#, J#, Microsoft Visual Basic .NET, Microsoft JScript .NET, and C++. All of these languages share a unified set of class libraries and can be encoded into an Intermediate Language (IL). A runtime-aware compiler compiles the IL into native executable code within a managed execution environment that ensures type safety, array bound and index checking, exception handling, and garbage collection.
1. Code that is executed by the CLR.
2. Code that targets the common language runtime, the foundation of the .NET Framework, is known as managed code.
3. Managed code supplies the metadata necessary for the CLR to provide services such as memory management, cross-language integration, code access security, and 4. 4. automatic lifetime control of objects. All code based on IL executes as managed code.
Code that executes under the CLI execution environment.
托管调试： Managed Debugging
!load SOS: 启动SOS。仅仅执行托管调试时不能载入SOS。解决办法是在 项目-->属性-->调试 页面打开启用非托管代码调试。加上断点，Debug
!DumpHeap -type className