2.2. Managed CodeCode created within the CLR environment is called managed code . Applications and libraries created using non-.NET tools, such as VB 6 applications, and COM and ActiveX components, are not managed code. You can still use unmanaged components in your .NET applications, but they must be referenced through special "interop" conduits to prevent the unmanaged code from having any detrimental impact on the managed side of the application. Having a central manager of all things .NET like the CLR makes possible some nice centralized functionality. One such feature in .NET is the garbage collection system, which automatically disposes of all variables and data objects when an application is finished with them, reclaiming every byte and releasing all references to the related memory. Managed execution is the process of running your .NET applications in the context of the CLR, although this process officially starts when writing your first line of .NET source code. There are three simple steps to managed execution .
One benefit of running applications within the CLR-managed environment is that data within the application is kept safe. The CLR keeps errant code and malformed data from interfering with the rest of memory, either in your application or elsewhere in the system. |