wrong build order in TeamCity
I have a solution consisting of several projects (it's a Silverlight 3.0 app with some server side and some client side projects). The solution just compiles fine in VS 2008 and it also compiles fine if I trigger the compilation locally from the command line (i.e. with msbuild.exe). But on our CI server (TeamCity) the build fails since the projects in the solution are compiled in the wrong order. Having one project A that references another project B - project A is compiled before project B - which obviously results in a reference not found compiler error.
I have double checked the references... I have rebuilt the solution file from scratch... No help
What am I missing?
Please sign in to leave a comment.
Not an answer, but just wanted to say I'm having exactly the same issue as Gabriel.
- Darren.
Found the solution to my problem.
TeamCity build log contained warnings like the following:
Project {54E4A6CF-6D2E-4971-A16F-92ADC2951739} is referencing a project with GUID {11ECBC69-AC80-44AD-9496-5A833B3F6D12}, but a project with this GUID was not found in the .SLN file.
So I guess MSBUILD (or the SLN2008 runner?) wasn't able to figure out the dependancies, therefore just built in some random order.
I had to manually edit the .sln file, to:
Rinse & repeat for each invalid reference.
Thanks to http://www.stevetrefethen.com/blog/SolutionFileWarningMSB4051GUIDWasNotFoundInTheSLNFile.aspx for a pointer in the right direction.
- Darren.
I had a similar problem where dependencies did not exist since the build order was out of order.
How I over came it was a simple fix to the solution file under the GlobalSection(ProjectConfigurationPlatforms) = postSolution.
Here I switched the list of projects to match the order I wished them to build;
example;
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{15AABA6A-7F03-47EA-B20B-FFF70B31929B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{15AABA6A-7F03-47EA-B20B-FFF70B31929B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{15AABA6A-7F03-47EA-B20B-FFF70B31929B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{15AABA6A-7F03-47EA-B20B-FFF70B31929B}.Release|Any CPU.Build.0 = Release|Any CPU
{029717E9-BC99-48B2-B4EE-703B558D6C49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{029717E9-BC99-48B2-B4EE-703B558D6C49}.Debug|Any CPU.Build.0 = Debug|Any CPU
{029717E9-BC99-48B2-B4EE-703B558D6C49}.Release|Any CPU.ActiveCfg = Release|Any CPU
{029717E9-BC99-48B2-B4EE-703B558D6C49}.Release|Any CPU.Build.0 = Release|Any CPU
{1D653552-969D-48E3-BC06-88BD24383452}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1D653552-969D-48E3-BC06-88BD24383452}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1D653552-969D-48E3-BC06-88BD24383452}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1D653552-969D-48E3-BC06-88BD24383452}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
I kept the project items grouped but ordered them how I wanted them built.
Hope this helps.