【问题标题】:MSBuild Error after upgrading TeamFoundation dlls to 2017将 TeamFoundation dll 升级到 2017 后出现 MSBuild 错误
【发布时间】:2018-11-28 13:53:27
【问题描述】:

因此,我们在项目中使用了 2013 TFS dll(即 TeamFoundation.Client、TeamFoundation.VersionControl.Client 和 TeamFoundation.Common)。我最近将项目升级为使用上述 dll 的 2017 版本(我们有 VS2017)。我从下面的文件夹中获取它们。

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer

升级后,当我构建解决方案时,出现以下错误:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.NETFramework.targets(56,5): warning : Resolved file has a bad image, no metadata, or is otherwise inaccessible. The system cannot find the path specified. (Exception from HRESULT: 0x80070003)

我不熟悉 MSBuild,所以不知道如何继续。

错误将我带到 MSBuild 代码中的以下行:

GetDependsOnNETStandard Condition="'$(_RunGetDependsOnNETStandard)' == 'true'"
                         References="@(_CandidateNETStandardReferences)">
  <Output TaskParameter="DependsOnNETStandard" PropertyName="DependsOnNETStandard" />
</GetDependsOnNETStandard>

【问题讨论】:

  • 您是尝试通过本地 Visual Studio 构建还是通过 TFS 服务器构建?
  • 我正在本地构建。但我发现了我的问题。安装 Microsoft.TeamFoundationServer.ExtendedClient nuget 包并重新构建后,错误消失了。

标签: dll tfs msbuild


【解决方案1】:

Visual Studio 2017 和 DependsOnNETStandard 存在一个悬而未决的问题,希望在 15.8 中得到解决

我今天在升级一个最初创建VS 2015并升级到VS 2017的项目时遇到了同样的问题。

项目的升级似乎遗漏了它需要的 XML 中的一些元素。

如果你编辑受影响项目的csproj文件并添加

<DependsOnNETStandard>false</DependsOnNETStandard>

到顶部的 PropertyGroup 像这样:

<PropertyGroup>
  ...
  <DependsOnNETStandard>false</DependsOnNETStandard>
</PropertyGroup>

它应该可以解决问题。它对我有用。

可以在以下位置找到有关该问题的详细信息和讨论: https://github.com/dotnet/sdk/issues/1544

【讨论】:

  • 谢谢,这对我有用。如果您可以包含指向未决问题的链接会更好(希望在 15.8 中修复)
  • 我已经编辑了答案,将问题的链接包含在 github 存储库中
【解决方案2】:

根据您的错误日志信息,您似乎正在尝试通过 Visual Studio 或 MsBuild 命令在本地构建而不是 TFS 构建。

建议您使用最新版本的 dll,Microsoft.TeamFoundationServer.Client,并将您的 Visual Studio 2017 升级到最新版本。对于The system cannot find the path specified. 问题尝试

  • 清理所有项目。
  • 卸载所有项目
  • 重新加载所有项目。
  • 重建解决方案

另一种方法是:

  • 关闭解决方案
  • 删除 bin 文件夹
  • 删除所有 obj 文件夹
  • 打开解决方案并构建

如果以上所有方法仍然不起作用,建议您添加更详细的日志和示例代码以进行故障排除。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-10-08
    • 1970-01-01
    • 2013-09-07
    • 2020-01-19
    • 2014-10-06
    • 1970-01-01
    • 2016-04-02
    相关资源
    最近更新 更多