CHAPTER 14 BUILDING AND CONFIGURING CLASS LIBRARIES
}
}
This code looks just like the code of the other applications developed thus far in the book. The only
point of interest is that the C# client application is now making use of types defined within a separate
custom library. Go ahead and run your program and verify that you see the display of various message
boxes.
You might be wondering exactly what happened when you referenced CarLibrary.dll using the Add
Reference dialog box. If you click the Show All Files button of the Solution Explorer, you will notice that
Visual Studio added a copy of the original CarLibrary.dll into the \bin\Debug folder of the
CSharpCarClient project folder (see Figure 14-8).
Figure 14-8. Visual Studio copies private assemblies to the client’s directory
As explained shortly, CarLibrary.dll has been configured as a “private” assembly (which is the
automatic behavior for all Visual Studio Class Library projects). When you reference private assemblies
in new applications (such as CSharpCarClient.exe), the IDE responds by placing a copy of the library in
the client application’s output directory.
Source Code The CSharpCarClient project is located under the Chapter 14 subdirectory.
523