Team Foundation Server 2010 / MSBuild: Error parsing the nested project section in solution file

大城市里の小女人 提交于 2019-12-12 10:30:43

问题


I'm trying to set up a nightly build for one of my company's products. When I execute the build, it fails after 45 or so seconds, giving the error "Error parsing the nested project section in solution file.

This is the log from the build:

Delete Binaries Directory

00:17 Delete Workspace

00:00 Delete Sources Directory

00:00 Create Workspace

00:18 Get Workspace

00:01 Create Label Label [label] (version W60_2_VMCORPTFS01;CL\me) was successfully created.

00:04 Compile, Test, and Associate Changesets and Work Items

00:04 Compile and Test

00:03 Run MSBuild for Project C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe /nologo /noconsolelogger "e:\localstore\Productname_2.0\Product\Product.sln" /m:1 /fl /flp:"logfile=e:\localstore\ThisSpecificBuild\Product\Product.log;encoding=Unicode;verbosity=normal" /p:SkipInvalidConfigurations=true /p:OutDir="C:\Builds\2\Product\ThisSpecificBuild\Binaries\" /p:Configuration="Debug" /p:Platform="Any CPU" /p:VCBuildOverride="e:\localstore\Productname_2.0\Product\Product.sln.Any CPU.Debug.vsprops" /dl:WorkflowCentralLogger,"C:\Program Files\Microsoft Team Foundation Server 2010\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Normal;BuildUri=vstfs:///Build/Build/2934;InformationNodeId=1175609;TargetsNotLogged=GetNativeManifest,GetCopyToOutputDirectoryItems,GetTargetPath;TFSUrl=http://localhost:8080/tfs/DefaultCollection;"*WorkflowForwardingLogger,"C:\Program Files\Microsoft Team Foundation Server 2010\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Normal;"

00:00 Built $/OMS/Branches/Product_2.0/Product/Product.sln for default targets. e:\localstore\ThisSpecificBuild\Product\Product.sln (1586): Error parsing the nested project section in solution file.

And this is the log from MSBuild:

Build started 7/6/2011 11:53:34 AM. e:\localstore\ThisSpecificBuild\Product\Product.sln(1586): Solution file error MSB5009: Error parsing the nested project section in solution file.

Build FAILED.

e:\localstore\ThisSpecificBuild\Product\Product.sln(1586): Solution file error MSB5009: Error parsing the nested project section in solution file.

0 Warning(s)
1 Error(s)

Time Elapsed 00:00:00.19

The solution builds correctly from within Visual Studio.


回答1:


Try to remove and then re-add some file, to cause sln file to be regenerated. This way I got build succeeded. My sln file was in an incorrect format for some reason.




回答2:


I just spent all afternoon on this and found a contributing factor. I found the entry in the .sln file referencing a project that did not exist in the solution. Nor was that phantom project's GUID referenced anywhere else in the .sln file.

Searching returned a couple tricks, such as http://social.msdn.microsoft.com/Forums/da-DK/msbuild/thread/55ab07ef-9179-4cc6-b2d0-63fcf088d8ba

Those "seemed" not to work, as local builds still succeeded and the Team Build still failed. Then I noticed that line 6199 in my solution was always at fault, even though that line was changing over time. It turned out the Team Build Definition had Clean Workspace set to Outputs instead of All. After changing it to All, the Team Build worked again.




回答3:


If you have modified the file manually or through merged tool, there might be an empty line left, which is OK with Visual Studio compilation, but fails in automation builds.




回答4:


For me renaming my Project and shorten the projectnames helped. It seems that, depending in which target directory tfs is dropping your solution, the max. lenght 256 for file names can be exceeded.



来源:https://stackoverflow.com/questions/6599966/team-foundation-server-2010-msbuild-error-parsing-the-nested-project-section

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!