如何从.csproj文件知道DLL的完整路径? [英] How to know full paths to DLL's from .csproj file?

查看:168
本文介绍了如何从.csproj文件知道DLL的完整路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有某种方法可以知道.csproj文件中列出的dll的完整路径。

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

对我来说最有趣的是解析到默认的dll,例如System.Xml.dll,System.Data.dll等。

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

在.csproj文件中只有短行的行:

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" />

我应该查看$ PATH变量并尝试解析给定dll的名称吗?还是什么?

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

推荐答案

您要检查的第一位是GAC。如果引用不在GAC中,则通常在引用下面会有相对或绝对路径,如下所示:

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

这篇关于如何从.csproj文件知道DLL的完整路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆