Archive for May 15th, 2008

What is a Manifest?

Thursday, May 15th, 2008

An assembly manifest contains all the metadata needed to specify the assembly’s version requirements and security identity, and all metadata needed to define the scope of the assembly and resolve references to resources and classes. The assembly manifest can be stored in either a PE (Portable Executable) file (an .exe or .dll) with Microsoft intermediate language (MSIL) code or in a standalone PE (Portable Executable) file that contains only assembly manifest information. The following table shows the information contained in the assembly manifest. The first four items the assembly name, version number, culture, and strong name information make up the assembly’s identity.

Posted by Mahesh ( Tryangled )

What is managed code and managed data?

Thursday, May 15th, 2008

Managed code is code that is written to target the services of the Common Language Runtime.In order to target these services, the code must provide a minimum level of information (metadata) to the runtime.All C#, Visual Basic .NET, and JScript .NET code is managed by default.Visual Studio .NET C++ code is not managed by default, but the compiler can produce managed code by specifying a command-line switch (/CLR).

Closely related to managed code is managed data–data that is allocated and de- allocated by the Common Language Runtime’s garbage collector. C#, Visual Basic, and JScript .NET data is managed by default.C# data can, however, be marked as unmanaged through the use of special keywords.Visual Studio .NET C++ data is unmanaged by default (even when using the /CLR switch), but when using Managed Extensions for C++, a class can be marked as managed using the __gc keyword. As the name suggests, this means that the memory for instances of the class is managed by the garbage collector.In addition, the class becomes a full participating member of the .NET Framework community, with the benefits and restrictions that it brings. An example of a benefit is proper interoperability with classes written in other languages (for example, a managed C++ class can inherit from a Visual Basic class).
An example of a restriction is that a managed class can only inherit from one base class.

Posted by Mahesh ( Tryangled )

What is “Common Language Runtime” (CLR)?

Thursday, May 15th, 2008

CLR is .NET equivalent of Java Virtual Machine (JVM). It is the runtime that converts a MSIL code into the host machine.
language code, which is then executed appropriately. The CLR is the execution engine for .NET Framework applications. It provides a number of services, including:
- Code management (loading and execution)
- Application memory isolation
- Verification of type safety
- Conversion of IL to native code.
- Access to metadata (enhanced type information)
- Managing memory for managed objects
- Enforcement of code access security
- Exception handling, including cross-language exceptions
- Interoperation between managed code, COM objects, and pre-existing DLL’s (unmanaged code and data)
- Automation of object layout
- Support for developer services (profiling, debugging, and so on).

Posted by Mahesh ( Tryangled )