我有一个包含asp.net C#项目4.0框架的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\WebApplications\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进行部署,它也可以按预期工作。我将使用VS2012中的一个基础项目创建一个新的解决方案,并测试它是否从Teamcity部署。
还有其他想法吗?
-更新
希望这不是解决方案:我做了与建议的on the above post相反的操作,我设置了MSBuild参数VisualStudioVersion=10.0,它可以工作!因此,为了部署VS2012项目,我不得不将其视为VS2010项目……你有什么不同之处?我应该怎么做才能在不欺骗团队的情况下进行部署?
-更新
我正在添加我的TeamCity配置的一些快照。Teamcity passes the system and environment variables as build parameters to MSBuild。




发布于 2012-11-02 10:37:48
已更新
为了澄清,问题是Web发布管道目标($(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets)没有作为VS2012的集成外壳版本的一部分安装。
这个问题可以通过安装VS2012的完整版来解决,或者可能通过在VS之上安装Azure SDK来解决。
https://stackoverflow.com/questions/13185897
复制相似问题