MsBuild找不到发布个人资料 [英] MsBuild not finding publish profile

查看:52
本文介绍了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:\ Program档案 (x86)\ MSBuild \ Microsoft \ VisualStudio \ v11.0 \ Web \ Microsoft.Web.Publishing.targets(4435, 5):PublishProfile的值设置为测试配置文件",预期 在以下位置找到文件 'C:\ BuildAgent \ work \ 61493e349d61af8c \ Yms.Web.Ui__profiles \ Test Profile.pubxml",但找不到.

[09:27:05][ValidatePublishProfileSettings] GetPublishingLocalizedString [09:27:05][GetPublishingLocalizedString] C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(4435, 5): The value for PublishProfile is set to 'Test Profile', expected to find the file at 'C:\BuildAgent\work\61493e349d61af8c\Yms.Web.Ui__profiles\Test 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:VisualStudioVersion=11.0 /p:Password = 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发布目标似乎无法正确评估发布配置文件的路径.

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.

我最终做了两件事:

  • 在生成服务器上安装Azure SDK(1.8)(否则将忽略发布配置文件)
  • 在Teamcity构建配置中强制使用"PublishProfileRootFolder"参数(否则,它将使用MS Web发布目标提供的错误路径)
  • installing the Azure SDK (1.8) on the build server (Otherwise the publish profiles were ignored)
  • forcing the "PublishProfileRootFolder" parameter in the Teamcity build configuration (Otherwise this uses the incorrect path provided by the MS Web Publishing Targets)

我的MSBuild命令参数如下:

My MSBuild command parameters looked as follows:

/P:DeployOnBuild = true
/P:PublishProfile = [我的个人资料的名称(不带文件扩展名)]
/P:PublishProfileRootFolder="%teamcity.build.checkoutDir%\Source\Web应用程序\ My Project \ PublishProfiles(存储发布配置文件的位置)
/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%\Source\Web Application\My Project\PublishProfiles" (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天全站免登陆