Free mag vol1 | Page 591

CHAPTER 14  BUILDING AND CONFIGURING CLASS LIBRARIES  Note You cannot install executable assemblies (*.exe) into the GAC. Only assemblies that take the *.dll file extension can be deployed as a shared assembly. With the release of .NET 4.0, Microsoft decided to isolate .NET 4.0 and higher libraries to a separate location, specifically C:\Windows\Microsoft.NET\assembly\GAC_MSIL (Figure 14-14). Figure 14-14. The .NET 4.0 and higher global assembly cache (GAC) Under this new folder, you will find a set of subdirectories, each of which is named identically to the friendly name of a particular code library (for example, \System.Windows.Forms, \System.Core, and so on). Beneath a given friendly name folder, you’ll find yet another subdirectory that always takes the following naming convention: v4.0_major.minor.build.revision_publicKeyTokenValue The “v4.0” prefix denotes that the library compiled under .NET version 4.0 or higher. That prefix is followed by a single underscore, then the version of the library in question (for example, 1.0.0.0). After a pair of underscores, you’ll see another number termed the publickeytoken value. As you will see in the next section, the public key value is part of the assembly’s “strong name.” Finally, under this folder, you will find a copy of the *.dll in question. In this book, I am assuming you are building applications using .NET 4.5; therefore, if you install a library to the GAC, it will be installed under C:\Windows\Microsoft.NET\assembly\GAC_MSIL. However, be very aware that if you were to configure a Class Library project to be compiled using version 3.5 or earlier, you would find shared libraries installed under C:\Windows\assembly. 533