Assemblies

An assembly is self describing
An assembly can consist of multiple modules all linked together by a manifest
Assemblies can have a version attached to them so that multiple assemblies with the same name but different versions can exist side-by-side and can be easily referenced.
An assembly is the basic unit of .NET Programming and is a single dynmaic link library or executable.
Private -
Shared -


An assembly contains the following:
Assembly Manifest
Application Manifest
Compiled Code - the Intermediate Language code and metadata
Resources
You can view the IL using the Visual Studio Disassembler tool - ILDSASM.exe



2 ways to name assemblies:
Strongly (fully) - has 4 parts - short name; version no; culture info; hash token
Partially - doesn't have all 4 parts


Advantage of strongly named is that they can be registered in the GAC and made available to other applications.
Private assemblies refer to assemblies not strongly named
The process of inspecting metadata is called reflection


Multiple assembly versions can be installed side by side


Every assembly has a "manifest" associated with it
This manifest replaces what was previously saved in the registry
This manifest contains metadata about the assembly


In VB this manifest obtains its information from the AssemblyInfo.vb file


My.Computer.Clipboard ??? Where


Protected - Accessible only from within that class or from a derived class
Friend - Accessible from within the same assembly
Private - Accessible from only inside that class or module
Shared - Is not accessible with a particular instance but can be used as a shared variable.




Custom XML File

This is usually saved in the user's local application directory

System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) 


In addition to the actual code, assemblies can also contain additional resources such as graphics files, type definitions for each class and metadata.
An assembly must have exactly one entry point.
DLLs - DLLMain, WinMain, Main DLLMain
Executables - WinMain
Console - Main


Assemblies are loaded on demand and are not loaded unless they are needed.
Assemblies are said to be self describing because the metadata fully describes the content of the assembly.
Each assembly has a version number.



An assembly provides the CLR with the information and compiled code that it needs to run the application.
It holds the Intermediate Langauge (IL) modules


References - always use Project References and not Binary references



Shared Assemblies

Must have a strong name
they are uniquely identified by their name and there version
when assemblies have different major, minor numbers they are considered to be incompatible.



Application Domains

The Windows operating system uses processes to isolate different applications.
This isolation is necessary to ensure that code running in one application doesn't interfere with code running in another application.
Application domains are created to provide this isolation.
An application domain is usually created by runtime host.
You must load an assembly into an application domain for the code to run.
A single application often has several assemblies all loaded into one single application domain.



An application domain gives the .NET Framework a way of isolating applications that are running in the same process.
For example when you are running multiple add-ins in the same application.
If one of them needs to be reloaded you don't want the other add-ins to be affected.
Loading the add-ins into separate application domains guarantees this isolation.


You can also set security permissions on an application domain.
For example when an application domain is created for a VSTO solution, the runtime sets a policy for the application domain so that it does not trust the My Computer Zone
This practice ensures that the code in the My Computer Zone has been granted trust explicitly rather than allowing all code to run by default.


Threads

For more information Threading > Processes
An App Domain can contain one or more threads.
Threads can cross between different App Domains.





© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext