Automated builds with CruiseControl.NET

Topics: CAB & Smart Client Software Factory
Nov 29, 2006 at 11:29 AM
originally posted by: bil_simser

Hi guys,

We have a CruiseControl server running that's building our projects. Works great with any VS2003/2005 project except the SCSF generated ones.

I can build from the command line fine by going to the solution directory and entering MSBuild MySolution.sln. The problem is when we try getting the cruise server to build it (using the MSBuild task). It hits the CoreCompile task and tries to build the Infrastructure.Library assembly but doesn't have a reference to Infrastructure.Interface where all the classes are. Here's a snippet from the MSBuild output:

Target "CoreCompile":
Building target "CoreCompile" completely.
Output file "obj\Debug\Infrastructure.Library.dll" does not exist.
Task "Csc":
/noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE
/debug+ /debug:full /optimize- /out:obj\Debug\Infrastructure.Library.dll /resource:obj\Debug\...(snip)
The "Csc" task is using "Csc.exe" from "C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Csc.exe".
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.
EntityTranslators\BaseTranslator.cs (13,59): error CS0234: The type or namespace name 'Interface' does not exist in the namespace 'Bantrel.Applications.SmartClientTest.Infrastructure' (are you missing an assembly reference?)

Like I said, it builds via MSBuild if I just type it from the command line (using the same parameters CC.NET is using) and from inside the IDE but I can't get MSBuild to do it in CC.NET.

This only happens with SCSF projects, any other solution where there's multiple project references and all that, works fine.

Any ideas?
Nov 29, 2006 at 11:43 AM
originally posted by: bil_simser

Note: I did build a new solution using the factory and it does not compile if you just run MSBuild SolutionName.sln.

It doesn't build the Infrastructure.Interface project at all even though it specifies it in the build order as first, other assemblies reference it, and it's in the solution file.

Another thing is there is some GUID problem that MSBuild reports about projects with GUIDs that don't exist. Perhaps the solution I'm generating isn't correct. Going to try another machine and build to see if that fixes it.
Nov 29, 2006 at 12:15 PM
originally posted by: bil_simser

Okay, I think I tracked down the problem.

MSBuild reports a "warning" that several assemblies are referencing GUIDs for projects that don't exist.

It turns out that all assemblies generated with SCSF (at least the ones I generate) are referencing the Infrastructure.Interface project but with the wrong GUID. You have to delete the reference and re-add it in Visual Studio to correct the GUID as the one generated by SCSF isn't correct.

Can anyone confirm this?
Nov 29, 2006 at 1:30 PM
originally posted by: bil_simser

One more wacko thing about this problem. I now thought I had it figured out but don't. The GUID problem is there when you generate a new solution so it's reproducible:

1. Create a new solution using SCSF
2. Launch MSBuild with the solution name from the command line

You should get the warning that projects are referencing non-existing GUIDs and the build fails. Relink the references and save and it should work fine.

I think I've stumbled over something on VS2005 that has been mentioned, namely that the IDE uses the project name to resolve the reference, but MSBuild references the GUID.

However one problem exists with my solution that I cannot figure out for the life of me.

I build in the command line with MSBuild and get this warning:

TestSolution.sln (,): warning MSB4051: Project {B72957D0-F8DF-4988-B873-39037CDBF65D} is referencing a project with GUID {BE39A9ED-D4C6-42E7-91D6-63D9B1D185C6}, but a project with this GUID was not found in the .SLN file.

The B72957D0 project is my Infrastructure.Library which only references Infrastructure.Interface.

The problem here is that I don't have any project, solution folder, or GUID anywhere with BE39A9ED... in it. I don't know where MSBuild is getting this from?
Dec 8, 2006 at 7:25 AM
originally posted by: sral


I've run into the same problem - did you solve it?


Lars Wilhelmsen
Senior Software Engineer
Teleplan Globe AS
Dec 8, 2006 at 7:55 PM
originally posted by: bil_simser


We finally got it resolved. Like I said, the factory generates some GUIDs that are incorrect and the reference in the files are correct, but the GUIDs are wrong. You just have to hunt down which GUIDs are for each reference project and match them up by manually editing the .sln and .csproj files in Notepad. When you run MSBuild on the solution file, you'll get the list of what projects are referring to what GUIDs and then just hunt them down the files and update them.