【问题标题】:TeamCity 9.x - build error cant find valid AspnetMergePathTeamCity 9.x - 构建错误找不到有效的 AspnetMergePath
【发布时间】:2017-01-18 01:11:19
【问题描述】:

我现在在我们所有的项目中都使用 VS 2015,但是这个特定的网络应用程序正在使用网络表单。应该没什么大不了的,因为我可以在我的工作站上本地执行发布到测试服务器而不会出现问题。

我之前设置了 TeamCity,但现在似乎无法配置新实例。使用 TeamCity 9.1.5(内部版本 37377),但服务器上没有 Visual Studio。

代码位于使用 Visual Studio 2015 创建的解决方案中。

与这些例子差不多 http://www.danmusk.com/how-to-build-asp-net-applications-in-teamcity-with-msbuild-tools-2013-and-net-framework-4-5-sdk/

已在服务器上安装MSBuild 2015 tools

在运行构建时,我得到了这个:

Microsoft.Web.Publishing.AspNetCompileMerge.targets(132, 5): Can't find the valid AspnetMergePath

我的构建步骤如下所示

[更新]
我想我可能已经找到了罪魁祸首——我查看了应该安装 Windows SDK 的位置,而且它非常稀疏。找不到 aspnetmerge 工具。哎呀,这可能就是我收到错误的原因?

[更新]

从命令行使用 msbuild,我得到 Microsoft.Web.Publishing.AspNetCompileMerge.targets(133,5):错误:找不到有效的 AspnetMergePath

另外,自从开始这一步以来,我已经安装了 Windows 10 SDK。我的 TeamCity 构建配置现在可以工作了。我已使用以下内容更新了我的 Microsoft.Web.Publishing.AspNetCompileMerge.targets 文件:

  <Target
      Name="GetAspNetMergePath"
      DependsOnTargets="$(GetAspNetMergePathDependsOn)"
      Condition ="'$(GetAspNetMergePath)' != 'false'">
    <PropertyGroup>
      <TargetFrameworkSDKToolsDirectory>C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\</TargetFrameworkSDKToolsDirectory>    
      <AspnetMergeName>aspnet_merge.exe</AspnetMergeName>
      <AspnetMergePath Condition="Exists('$(TargetFrameworkSDKToolsDirectory)$(AspnetMergeName)')">$(TargetFrameworkSDKToolsDirectory)</AspnetMergePath>
    </PropertyGroup>
    <Error Condition="'$(AspnetMergePath)' == '' Or !Exists($(AspnetMergePath))"
           Text="Can't find the valid AspnetMergePath" />
  </Target>

【问题讨论】:

  • 如果直接通过MSBuild命令构建部署项目,结果如何?
  • 根据您的更新,您的问题已经解决,您可以在24小时后发布答案并标记。

标签: asp.net visual-studio msbuild teamcity


【解决方案1】:

查看原帖中的更新。我试图构建的服务器上有非常少的旧 SDK。我获取了最新的 Windows 10 SDK,安装并更新了 Microsoft.Web.Publishing.AspNetCompileMerge.targets 文件,如上所示。然后重新启动两个 TeamCity 服务,构建终于成功了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-12
    • 1970-01-01
    相关资源
    最近更新 更多