13
votes

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.

5
So what are the lines in the solution file surrounding line 1586?Brian Kretzler
I was all excited because I hadn't thought of that, but it turns out there are only 942 lines in the solution file. I think that might be the right path, though.Chris
Not a duplicate but has a very similar set of solutions to the problem: stackoverflow.com/questions/36777583/…StayOnTarget

5 Answers

22
votes

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.

4
votes

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
votes

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.

0
votes

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.

0
votes

I faced the same issue and managed to sort it out:

  1. Opened .sln in NotePad and found Guids
  2. One of my projects wasn't closed ("EndProject" was missed)

Cheers, hope this can help anyone