问题
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:
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
回答2:
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.
来源:https://stackoverflow.com/questions/2244881/how-to-know-full-paths-to-dlls-from-csproj-file