Teamcity:VS 2010解决方案在转换为VS 2012解决方案后无法部署

时间:2012-11-01 21:38:22

标签: msbuild visual-studio-2012 teamcity msdeploy

我有一个包含asp.net C#项目,4.0 Framework的VS 2010解决方案。我们使用Teamcity 7.1.1(build 24074)作为CI和部署服务器。

我们升级到Visual Studio 2012并转换了此解决方案,并在构建服务器上安装了Microsoft Visual Studio 2012 Shell (Integrated) Redistributable Package,以便拥有构建visual studio应用程序所需的所有文件,包括[..] \ MSBuild \ Microsoft \ VisualStudio \ v11 0.0 \ web应用\ Microsoft.WebApplication.targets。

转换到2012之后,我注意到部署不再起作用,没有创建工件(但Teamcity也没有抱怨!)。我只在构建日志中得到这个:

[...]
[17:11:58][Providers\Providers.csproj.teamcity] GetCopyToOutputDirectoryItems
[17:11:58][Providers\Providers.csproj.teamcity] _CopyOutOfDateSourceItemsToOutputDirectoryAlways
[17:11:58][_CopyOutOfDateSourceItemsToOutputDirectoryAlways] Copy
[17:11:58][Copy] Copying file from "C:\TeamCity\buildAgent\work\c52628138e1ee4d4\Providers\NLog.config" to "bin\NLog.config".
[17:11:58][Providers\Providers.csproj.teamcity] CopyFilesToOutputDirectory
[17:11:58][CopyFilesToOutputDirectory] Copy
[17:11:58][Copy] Copying file from "obj\Release\Providers.dll" to "bin\Providers.dll".
[17:11:58][CopyFilesToOutputDirectory] Providers.csproj -> C:\TeamCity\buildAgent\work\c52628138e1ee4d4\Providers\bin\Providers.dll
[17:11:58][CopyFilesToOutputDirectory] Copy
[17:11:58][Copy] Copying file from "obj\Release\Providers.pdb" to "bin\Providers.pdb".

==> [17:11:58]Process exited with code 0

[17:11:58]Publishing internal artifacts
[17:11:58][Publishing internal artifacts] Sending build.finish.properties.gz file
[17:11:58]Publishing artifacts
[17:11:58][Publishing artifacts] Collecting files to publish: [Providers\obj\Release\Package]

==> [17:11:58][Publishing artifacts] Artifacts path Providers/obj/Release/Package not found

[17:11:58]Build finished

对解决方案所做的唯一更改是在.sln和.csproj文件中(由Visual Studio提供)。如果我恢复到以前的版本,teamcity构建和部署没有问题。 对项目文件的更改与explained in this post相同,我尝试了建议的解决方案(将VisualStudioVersion = 11.0传递给MSBuild),但它无效。

如果我使用解决方案资源管理器中的“发布”链接从Visual Studio进行部署,它也可以按预期工作。我将在VS 2012中使用基础项目创建一个新的解决方案,并测试它是否从Teamcity部署。

还有其他想法吗?

---更新---

希望这不是解决方案:我做了相反的建议on the above post,我设置了MSBuild参数VisualStudioVersion = 10.0并且它有效! 因此,为了部署VS 2012项目,我不得不将其视为VS 2010项目......你在做什么与众不同?为了能够在不欺骗团队城市的情况下进行部署,我应该做些什么?

---更新---

我正在添加TeamCity配置的一些快照。 Teamcity passes the system and environment variables as build parameters to MSBuild

General Settings

Build Steps

MSBuild

Configuration Parameters

1 个答案:

答案 0 :(得分:3)

<强>更新

为了澄清,问题是Web发布管道目标($(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets)未作为VS 2012集成Shell版本的一部分安装。

可以通过安装完整版本的VS 2012或可能通过在VS Shell顶部安装Azure SDK来解决此问题。