Sunday, June 30, 2013

What is an assembly?

Tags

An assembly is sometimes described as a logical .EXE or .DLL, and can be an application(with a main entry point) or a library.

An assembly consists of one or more files (dlls, exes, html files etc), and represents a group of resources, type definitions, and implementations of those types. An assembly may also contain references to other assemblies.

These resources, types and references are described in a block of data called a manifest. The manifest is part of the assembly, thus making the assembly self-describing. An important aspect of assemblies is that they are part of the identity of a type. The identity of a type is the assembly that houses it combined with the type name.

This means, for example, that if assembly A exports a type called T, and assembly B exports a type called T, the .NET runtime sees these as two completely different types. Furthermore, don't get confused between assemblies and namespaces- namespaces are merely a hierarchical way of organising type names. To the runtime, type names are type names,regardless of whether namespaces are used to organise the names.


EmoticonEmoticon