Assemblies
The purpose of an assembly is to specify a logical unit, or building block, for .NET applications that encapsulate certain properties.
The term assembly refers to both a logical construct and a set of physical files. To draw an analogy on the logical side, we might use the term neighborhood to refer to a zip code, a neighborhood name, and a list of street addresses. On the physical side, a neighborhood consists of the actual houses that are located at those addresses. Thus, we can speak of physically moving (i.e., deploying) the neighborhood.
A .NET application consists of one or more assemblies. Logically speaking, an assembly is just a set of specifications. In particular:
An assembly specifies the (MSIL) code that is associated with the assembly. This code lies in a Portable Executable (PE) file. (PE files are the traditional file types for Microsoft’s code, but the format is extended for .NET applications.)
An assembly specifies security permissions for itself, if any.
An assembly specifies a list of data types and provides scoping for those types. Every data type in a .NET application must specify the assembly to which it belongs. The scoping provided by an assembly means that different types may have the same name, as long as they belong to different assemblies and can therefore be distinguished by means of the assembly to which they belong. Microsoft refers to this by saying that an assembly provides atype boundary.
An assembly specifies rules for resolving external ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access