使用TeamCity运行构建时获取MSBuild错误MSB3202

时间:2010-11-24 17:58:09

标签: msbuild teamcity

我被赋予了为我们的小型.Net商店研究和实施CI的任务。在进行研究之后,我们选择了TeamCity进行自动化构建。安装TeamCity和MSBuild非常简单,但问题是我开始构建时。我总会得到一个错误。从事物的外观来看,它试图调用共享库项目,所以我做的第一件事就是编辑VCS以包含共享库,但这并没有解决问题。

请查看构建中的日志,如果需要通过TeamCity或VS 2008配置MSBuild,请告诉我们?

[09:32:29]: Checking for changes
[09:32:31]: Clearing temporary directory: C:\Program Files\TeamCity\BuildAgent\temp\buildTmp
[09:32:31]: Checkout directory: C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3
[09:32:31]: Updating sources: server side checkout... (3s)
[09:32:31]: [Updating sources: server side checkout...] Building incremental patch for VCS root: Shared Libraries
[09:32:33]: [Updating sources: server side checkout...] Building incremental patch for VCS root: My TFS Two
[09:32:35]: [Updating sources: server side checkout...] Repository sources transferred
[09:32:35]: Project "Apollo.sln.teamcity.patch.tcprojx" (TeamCity_Generated_Build 
target(s)):
[09:32:36]: [Project "Apollo.sln.teamcity.patch.tcprojx" (TeamCity_Generated_Build target(s)):] ..\..\..\Shared Libraries\Local.Data\v2\Local.Data.csproj warning MSB4122: Scanning project dependencies for project "..\..\..\Shared Libraries\Local.Data\v2\Local.Data.csproj" failed. The project file "C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\..\..\..\Shared Libraries\Local.Data\v2\Local.Data.csproj" was not found.
[09:32:36]: [Project "Apollo.sln.teamcity.patch.tcprojx" (TeamCity_Generated_Build target(s)):] ..\..\..\Shared Libraries\Local.Web\v2\Local.Web.csproj warning MSB4122: Scanning project dependencies for project "..\..\..\Shared Libraries\Local.Web\v2\Local.Web.csproj" failed. The project file "C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\..\..\..\Shared Libraries\Local.Web\v2\Local.Web.csproj" was not found.
[09:32:36]: [Project "Apollo.sln.teamcity.patch.tcprojx" (TeamCity_Generated_Build target(s)):] ..\..\..\Shared Libraries\Twitterizer\root\Twitterizer.OAuth\Twitterizer.OAuth.csproj warning MSB4122: Scanning project dependencies for project "..\..\..\Shared Libraries\Twitterizer\root\Twitterizer.OAuth\Twitterizer.OAuth.csproj" failed. The project file "C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\..\..\..\Shared Libraries\Twitterizer\root\Twitterizer.OAuth\Twitterizer.OAuth.csproj" was not found.
[09:32:36]: [Project "Apollo.sln.teamcity.patch.tcprojx" (TeamCity_Generated_Build target(s)):] ..\..\..\Shared Libraries\log4net\root\log4net.csproj warning MSB4122: Scanning project dependencies for project "..\..\..\Shared Libraries\log4net\root\log4net.csproj" failed. The project file "C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\..\..\..\Shared Libraries\log4net\root\log4net.csproj" was not found.
[09:32:36]: [Project "Apollo.sln.teamcity.patch.tcprojx" (TeamCity_Generated_Build 
target(s)):] Project "Apollo.sln" (Rebuild target(s)):
[09:32:36]: [Project "Apollo.sln" (Rebuild target(s)):] Building solution configuration "Deployment|Any CPU".
[09:32:36]: [Project "Apollo.sln" (Rebuild target(s)):] C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\Apollo.sln error MSB3202: The project file "..\..\..\Shared Libraries\Local.Data\v2\Local.Data.csproj" was not found.
[09:32:36]: [Project "Apollo.sln" (Rebuild target(s)):] C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\Apollo.sln error MSB3202: The project file "..\..\..\Shared Libraries\Local.Web\v2\Local.Web.csproj" was not found.
[09:32:36]: [Project "Apollo.sln" (Rebuild target(s)):] C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\Apollo.sln error MSB3202: The project file "..\..\..\Shared Libraries\log4net\root\log4net.csproj" was not found.
[09:32:36]: [Project "Apollo.sln" (Rebuild target(s)):] C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\Apollo.sln error MSB3202: The project file "..\..\..\Shared Libraries\Twitterizer\root\Twitterizer.OAuth\Twitterizer.OAuth.csproj" was not found.
[09:32:36]: MSBuild output:
[09:32:36]: C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\Apollo.sln : error MSB3202: The project file "..\..\..\Shared Libraries\Local.Web\v2\Local.Web.csproj" was not found.
[09:32:36]: C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\Apollo.sln : error MSB3202: The project file "..\..\..\Shared Libraries\log4net\root\log4net.csproj" was not found.
[09:32:36]: C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\Apollo.sln : error MSB3202: The project file "..\..\..\Shared Libraries\Twitterizer\root\Twitterizer.OAuth\Twitterizer.OAuth.csproj" was not found.
[09:32:36]: Done Building Project "C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\Apollo.sln" (Rebuild target(s)) -- FAILED.
[09:32:36]: Done Building Project "C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\Apollo.sln.teamcity.patch.tcprojx" (TeamCity_Generated_Build target(s)) -- FAILED.
[09:32:36]: Build FAILED.
[09:32:36]: "C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\Apollo.sln.teamcity.patch.tcprojx" (TeamCity_Generated_Build target) (1) ->
[09:32:36]: (TeamCity_Generated_Build target) ->
[09:32:36]: ..\..\..\Shared Libraries\Local.Data\v2\Local.Data.csproj : Solution file warning MSB4122: Scanning project dependencies for project "..\..\..\Shared Libraries\Local.Data\v2\Local.Data.csproj" failed. The project file "C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\..\..\..\Shared Libraries\Local.Data\v2\Local.Data.csproj" was not found.
[09:32:36]: ..\..\..\Shared Libraries\Local.Web\v2\Local.Web.csproj : Solution file warning MSB4122: Scanning project dependencies for project "..\..\..\Shared Libraries\Local.Web\v2\Local.Web.csproj" failed. The project file "C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\..\..\..\Shared Libraries\Local.Web\v2\Local.Web.csproj" was not found.
[09:32:36]: ..\..\..\Shared Libraries\Twitterizer\root\Twitterizer.OAuth\Twitterizer.OAuth.csproj : Solution file warning MSB4122: Scanning project dependencies for project "..\..\..\Shared Libraries\Twitterizer\root\Twitterizer.OAuth\Twitterizer.OAuth.csproj" failed. The project file "C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\..\..\..\Shared Libraries\Twitterizer\root\Twitterizer.OAuth\Twitterizer.OAuth.csproj" was not found.
[09:32:36]: ..\..\..\Shared Libraries\log4net\root\log4net.csproj : Solution file warning MSB4122: Scanning project dependencies for project "..\..\..\Shared Libraries\log4net\root\log4net.csproj" failed. The project file "C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\..\..\..\Shared Libraries\log4net\root\log4net.csproj" was not found.
[09:32:36]: "C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\Apollo.sln.teamcity.patch.tcprojx" (TeamCity_Generated_Build target) (1) ->
[09:32:36]: "C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\Apollo.sln" (Rebuild target) (2) ->
[09:32:36]: (Rebuild target) ->
[09:32:36]: C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\Apollo.sln : error MSB3202: The project file "..\..\..\Shared Libraries\Local.Data\v2\Local.Data.csproj" was not found.
[09:32:36]: C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\Apollo.sln : error MSB3202: The project file "..\..\..\Shared Libraries\Local.Web\v2\Local.Web.csproj" was not found.
[09:32:36]: C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\Apollo.sln : error MSB3202: The project file "..\..\..\Shared Libraries\log4net\root\log4net.csproj" was not found.
[09:32:36]: C:\Program Files\TeamCity\BuildAgent\work\18eca7a0915880c3\Apollo.sln : error MSB3202: The project file "..\..\..\Shared Libraries\Twitterizer\root\Twitterizer.OAuth\Twitterizer.OAuth.csproj" was not found.
[09:32:36]: 4 Warning(s)
[09:32:36]: 4 Error(s)
[09:32:36]: Time Elapsed 00:00:00.60
[09:32:36]: Publishing artifacts
[09:32:36]: [Publishing artifacts] Paths to publish: [teamcity-info.xml]
[09:32:36]: [Publishing artifacts] Publishing files
[09:32:36]: Build finished

3 个答案:

答案 0 :(得分:7)

这是一个非常简单的错误 - MSBuild无法找到您正在尝试构建的项目文件。有两种可能的解释:

  1. 您尚未将这些项目检入您的版本控制存储库
  2. 您已对其进行了检查,但未在MSBuild希望找到它们的位置进行检查。
  3. 版本控制中源文件的结构应与您在Visual Studio中本地构建的结构相匹配。如果不是,你将继续遇到问题。

答案 1 :(得分:0)

问题似乎不在MSBuild中,而是在TeamCity项目配置的版本控制设置中。验证您希望存在的文件是否位于构建代理程序的工作子目录中。将这些与Visual Studio项目和构建日志进行比较;验证路径是否正确。

您还可以在TeamCity Developer Community上发布问题。

答案 2 :(得分:0)

我注意到你的路径实际上把项目放在了工作目录之外......假设这是正确的:

我收到的这条消息的构建在一个不同的项目中完美运行,并且我验证了项目文件在磁盘上。

唯一的区别是' Checkout目录' “版本控制设置”下的名称'高级选项部分。事实证明,msbuild中的路径模式匹配无法处理长路径 ..

我将结帐目录名称更改为只有三个字母,并且发现项目文件正常。