views:

180

answers:

2

Hi, I wonder if there is some way to know full paths to the dll's that are listed in .csproj file.

The most interesting for me is to resolve paths to default dll's like System.Xml.dll, System.Data.dll and etc.

In the .csproj file there are only lines with short names:

<Reference Include="System.Xml.Linq">
  <RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
  <RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />

Should I look to the $PATH variable and try to resolve given dll's name ? Or what ?

+1  A: 

The first place you would check is the GAC. If the reference is not in the GAC, then most often there will be a relative or absolute path below the Reference like this:

<Reference Include="mydll">
  <HintPath>..\..\mydll.dll</HintPath>
</Reference
Steve Danner
Thanks!One question:I have run gacutil.exe -l and have seen just dll names with no paths but only short names ... I need full paths.
Nelly
Are you wanting to use code to find the exact location of a dll, or are you just wanting to look for yourself to find the location?
Steve Danner
A: 

If its any .NET library like you examples then they will generally be in the following folder: C:\Windows\Microsoft.NET\Framework\< .net version >\ or whaterver is specified in the GAC. Otherwise there will be a HintPath which will be a relative path to your current folder.

Simon G