【问题标题】:Where is MsDeployPublish located?MsDeployPublish 位于哪里?
【发布时间】:2013-10-10 12:32:57
【问题描述】:

尝试使用 TeamCity 和 Web Deploy 部署我的网站时,我收到此错误:

error MSB4057: The target "MsDeployPublish" does not exist in the project.

有什么我必须在构建服务器上安装的吗?这是安装了 Web Deploy 3.5 的干净的 Windows Server 2012。

【问题讨论】:

    标签: teamcity webdeploy build-server


    【解决方案1】:

    或者您可以将此 NuGet 包与可移植版本的目标一起使用:https://www.nuget.org/packages/MSBuild.Microsoft.VisualStudio.Web.targets 并修改您的 csproj 文件以包含它,如下所示:

    <Import Project="..\packages\MSBuild.Microsoft.VisualStudio.Web.targets.12.0.1\tools\VSToolsPath\WebApplications\Microsoft.WebApplication.targets" />
    

    【讨论】:

    • 如果您不想安装 Visual Studio,这是构建服务器上 TeamCity 的最佳答案。有几点需要注意 - 确保路径引用与您安装的 Web.targets 的版本相匹配,并确保上面的 Import 行替换了 Microsoft.WebApplication.targets 的任何其他 Import 引用(它们可能在 web.target 的更下方。 config 文件),否则你会得到一个“‘exists’函数只接受一个标量值”的编译错误。
    • @Raelshark 的评论:我不确定我是否很幸运并且一切都匹配了,但是只需添加对我有用的 nuget 包。 nuget 包括 14.0.0.3,在构建配置中制作我的复制文件夹 C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14` to the agent server. That in turn matches the ToolsVersion 之前的一些其他步骤。 Teamcity 及其文档... :(
    【解决方案2】:

    我意识到这个问题现在已经很老了,但是:

    MsDeployPublish 作为 Visual Studio 的一部分与 Web 应用程序目标一起安装。如果您只安装了 Server + Web Deploy,则需要从开发人员安装中复制它们或安装 Visual Studio。可以从%programfiles(x86)%\MSBuild\Microsoft\VisualStudio复制目标

    顺便说一句,在 Visual Studio 2012 发布之后添加了一些功能,即与发布配置文件 (.pubxml) 相关的功能。这些可以通过安装Azure SDK添加到VS2010,并将安装到%programfiles(x86)%\MSBuild\Microsoft\VisualStudio\v10.5\Web

    【讨论】:

    • 这解决了我的问题。我只在我的工作站上安装了 WebDeploy 的服务器版本。我需要安装完整版的 WebDeploy 才能正确构建。
    【解决方案3】:

    这对我有用,我必须添加行来导入 Microsoft.WebApplication.targets 从一个好的 VS2013 项目中得到。

    <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
      <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
      <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
    

    【讨论】:

      猜你喜欢
      • 2013-09-08
      • 2021-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-25
      相关资源
      最近更新 更多