A quick review
The .NET GAC is a repository for system-wide shared assemblies.
It is used primarily by Microsoft as the public location for the .NET Framework.
Reference Assemblies
In Visual Studio, if you add a reference to a Microsoft assembly (E.g. System.Data.dll
), the compiler will resolve the reference to a directory under Program Files \ Reference Assemblies. It does not point to the GAC. Not yet. Not until runtime.
System.Data.dll
in the Object Browser: Note that the reference does not point to the GAC, even though the assembly will be loaded from the GAC at runtime.
The Reference Assembly constitutes the published API for a specific version of the framework. If you link to v4.6.1, for example, then you won't see methods that were added in v4.6.2.
It allows you to target a version the Framework, as it appeared when it was released. Unlike the GAC, you won't see patch updates. Using Reference Assemblies prevents you from unintentionally using methods that were not present in the initial public release. You will still get the runtime behaviour of the assembly that is installed in the GAC (patches included), but the metadata in the Reference Assembly will prevent you from coding against a method that was added (or removed) in a subsequent build.
Checking the load path
You can view the runtime load path in the VS Output Window, or under Debug ... Windows ... Modules.
For a 32-bit process, you will see:
For a 64-bit process, you will see: