Free mag vol1 | Page 575

CHAPTER 14  BUILDING AND CONFIGURING CLASS LIBRARIES Notice how each subclass implements TurboBoost() using the Windows Form’s MessageBox class, which is defined in the System.Windows.Forms.dll assembly. For your assembly to make use of the types defined within this external assembly, the CarLibrary project must set a reference to this binary via the Add Reference dialog box (see Figure 14-3), which you can access through the Visual Studio Project  Add Reference menu selection. Figure 14-3. Referencing external .NET assemblies using the Add Reference dialog box It is really important to understand that the assemblies displayed in the Framework area of the Add Reference dialog box do not represent each and every assembly on your machine. The Add Reference dialog box will not display your custom libraries, and it does not display all libraries located in the Global Assembly Cache (GAC; more details later in the chapter). Rather, this dialog box simply presents a list of common assemblies that Visual Studio is preprogrammed to display. When you are building applications that require the use of an assembly not listed within the Add Reference dialog box, you need to click the Browse node to manually navigate to the *.dll or *.exe in question.  Note Be aware that the Recent section of the Add Reference dialog box keeps a running list of previously referenced assemblies. This can be handy, as many .NET projects tend to use the same core set of external libraries. 517