MsBuild 找不到发布配置文件 [英] MsBuild not finding publish profile

查看:29
本文介绍了MsBuild 找不到发布配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 VS 2012 解决方案,其中包含我试图通过 TeamCity/MsBuild 命令行部署的两个项目(WCF C# Service App 和一个 VB Web UI).每个项目都包含一个发布配置文件——我们称之为测试配置文件"——在使用 IDE 执行时可以正常工作.

I have a VS 2012 solution that contains two projects (WCF C# Service App and a VB Web UI) that I'm trying to deploy via TeamCity/MsBuild command line. Each project contains a publish profile - let's call it "Test Profile" - that works fine when executed from withing the IDE.

但是,当作为两个连续的构建步骤执行时,C# 项目部署正常,但 VB 项目失败并出现以下错误:

However, when executed as two consecutive build steps, the C# project deploys fine, but the VB project fails with the following error:

[09:27:05][ValidatePublishProfileSettings]GetPublishingLocalizedString [09:27:05][GetPublishingLocalizedString]C:程序文件(x86)MSBuildMicrosoftVisualStudiov11.0WebMicrosoft.Web.Publishing.targets(4435,5): PublishProfile 的值设置为测试配置文件",预计找到文件'C:BuildAgentwork61​​493e349d61af8cYms.Web.Ui__profilesTestProfile.pubxml' 但找不到.

[09:27:05][ValidatePublishProfileSettings] GetPublishingLocalizedString [09:27:05][GetPublishingLocalizedString] C:Program Files (x86)MSBuildMicrosoftVisualStudiov11.0WebMicrosoft.Web.Publishing.targets(4435, 5): The value for PublishProfile is set to 'Test Profile', expected to find the file at 'C:BuildAgentwork61493e349d61af8cYms.Web.Ui__profilesTest Profile.pubxml' but it could not be found.

每个构建步骤都设置为使用 MsBuild v4.0、Run Platform x64、ToolsVersion 4.0.命令行参数为:

Each build step is setup to use MsBuild v4.0, Run Platform x64, ToolsVersion 4.0. The command line parameters are:

/P:Configuration="测试配置文件"
/p:DeployOnBuild=true/p:PublishProfile="测试配置文件"
/p:VisualStudio 版本=11.0/p:密码=james2

/P:Configuration="Test Profile"
/p:DeployOnBuild=true /p:PublishProfile="Test Profile"
/p:VisualStudioVersion=11.0 /p:Password=james2

当针对解决方案而不是项目作为单个构建步骤运行时,我收到相同的错误,除了错误消息中的Ui_profiles"被PublishProfiles"替换.

When run as a single build step against the solution rather than projects, I get the same error, except "Ui_profiles" in the error message is replaced with "PublishProfiles".

非常感谢任何帮助,这让我很生气

Any help at all is much appreciated, this is driving me batty

推荐答案

我遇到了完全相同的问题,但是对于 VS2010 Web 应用程序项目(使用 Azure SDK 1.8 更新来更新发布选项).似乎 MS 提供的 Web Publishing Targets 无法正确评估 Publish Profiles 的路径.

I had exactly the same issue but for a VS2010 Web Application project (with the Azure SDK 1.8 update to update the publishing options). It seemed as if the Web Publishing Targets provided by MS wouldnt evaluate the path for the Publish Profiles correctly.

我最终做了两件关键的事情:

I ended up doing two key things:

  • 在构建服务器上安装 Azure SDK (1.8)(否则发布配置文件将被忽略)
  • 在 Teamcity 构建配置中强制使用PublishProfileRootFolder"参数(否则会使用 MS Web 发布目标提供的不正确路径)

我的 MSBuild 命令参数如下所示:

My MSBuild command parameters looked as follows:

/P:DeployOnBuild=true
/P:PublishProfile=[我的个人资料名称(不带文件扩展名)]
/P:PublishProfileRootFolder="%teamcity.build.checkoutDir%SourceWeb ApplicationMy ProjectPublishProfiles"(存储您的发布配置文件的位置)
/P:AllowUntrustedCertificate=true
/P:Password=%env.DomainPassword%

/P:DeployOnBuild=true
/P:PublishProfile=[Name of My Profile (without a file extension)]
/P:PublishProfileRootFolder="%teamcity.build.checkoutDir%SourceWeb ApplicationMy ProjectPublishProfiles" (where your publish profiles are stored)
/P:AllowUntrustedCertificate=true
/P:Password=%env.DomainPassword%

希望这对同一条船上的人有所帮助!

Hope this helps somebody in the same boat!

这篇关于MsBuild 找不到发布配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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