我有一个 VS 2012 解决方案,其中包含我试图通过 TeamCity/MsBuild 命令行部署的两个项目(WCF C# 服务应用程序和一个 VB Web UI)。每个项目都包含一个发布配置文件——我们称之为“测试配置文件”——在使用 IDE 执行时可以正常工作。
但是,当作为两个连续的构建步骤执行时,C# 项目部署正常,但 VB 项目失败并出现以下错误:
[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。命令行参数为:
/P:Configuration="Test Profile"
/p:DeployOnBuild=true /p:PublishProfile="Test Profile"
/p:VisualStudioVersion=11.0 /p:Password=james2
当针对解决方案而不是项目作为单个构建步骤运行时,我得到相同的错误,除了错误消息中的“Ui_profiles”被替换为“PublishProfiles”。
非常感谢任何帮助,这让我很生气
最佳答案
我遇到了完全相同的问题,但对于 VS2010 Web 应用程序项目(使用 Azure SDK 1.8 更新来更新发布选项)。 MS 提供的 Web 发布目标似乎无法正确评估发布配置文件的路径。
我最终做了两件关键的事情:
我的 MSBuild 命令参数如下所示:
/P:DeployOnBuild=true
/P:PublishProfile=[我的个人资料名称(没有文件扩展名)]
/P:PublishProfileRootFolder="%teamcity.build.checkoutDir%\Source\Web Application\My Project\PublishProfiles"(您的发布配置文件的存储位置)
/P:AllowUntrustedCertificate=true
/P:密码=%env.DomainPassword%
希望这可以帮助同一条船上的人!
关于visual-studio - MsBuild 找不到发布配置文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17840044/