Simple question: In Visual Studio, how can I see whether an assembly is referenced from the GAC or whether the reference is simply referenced through the (‘normal’) file system?
I thought I’d be able to deduct this by looking at the .csproj file but maybe not. Here’s an outtake from my .csproj-file:
<Reference Include="MoreLinq, Version=1.0.11522.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\MoreLinq.dll</HintPath>
</Reference>
<Reference Include="Oracle.DataAccess, Version=9.2.0.401, Culture=neutral, PublicKeyToken=89b483f429c47342">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System" />
I know that Oracle.DataAccess and System is referenced from the GAC and MoreLing (thanks Jon!) is referenced through the file system. The only difference I can see is that MoreLinq has a HintPath value. Is that what distinguishes a GAC reference from a file reference? In any case I can’t see this in VS
Since this has a big impact on how assemblies are loaded, I would assume this information would be easy to get to, but I may be wrong?
I think that you can’t know this for sure without running the program. If the ‘Copy local’ property of the reference is set to False, it shows that the DLL comes from the GAC.
But remember that the GAC has priority over the rest of the file system (including the current directory).
At run-time, you can be sure through the Debug / Windows / Modules window, where you can see the exact path of the loaded DLL.