This appendix describes a number of useful techniques for working with assemblies. Among the topics covered are how to create modules, how to manage the global assembly cache, how to make assemblies shareable, and how to use the nmake utility to automate your builds.
For most applications you build components that are either standalone assembly EXEs or DLLs. If you want to build shareable components that are shared across multiple applications, you need to give your assembly a strong name (using the sn utility) and install it into the shared assembly (using the al utility).
The al utility doesn’t rebuild assemblies from other assemblies, so you need to compile your C# files as modules, using the flag (/target:module). Here’s an example:
csc /target:module a.cs
Once your modules are built, you can create a single shared assembly with the al (alink) utility. You specify the name of the new assembly and the source modules. Here’s an example:
al /out:c.dll a.dll b.dll
You can now create applications with the new assembly by referencing it on the compiler command line. Example:
csc /r:c.dll d.cs
Note that in order to use classes within the namespaces contained in
the c.dll assembly of the preceding example, you
need to specify the
using keyword to reference the
To share assemblies across multiple applications where the assembly ...