Sunday, March 15, 2009

TeamCity build error

I’ve recently installed TeamCity so far have been impressed. Quick and easy to set up.
I did however have a couple of build errors that I’ve just resolved so I thought I’d blog about them as I found a hard to find anything on this error.
Firstly, as my project being built is a Silverlight project I was getting the error below
Default.aspx.designer.cs(50, 41): error CS0234: The type or namespace name 'SilverlightControls' does not exist in the namespace 'System.Web.UI' (are you missing an assembly reference?)

The problem was that the TeamCity build server didn’t have the dependencies needed to do the build, namely the Silverlight SDK. I installed the SDK (the standalone version, not the toolkit for VS which also includes the SDK) and that error disappeared.
The other error I was getting was this one:
"D:\TeamCity\buildAgent\work\28a2267b1fea9d4e\appname\SubsetFontSilverlight.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

This seemed to be being caused by a line in the project file which gets added by Expression Blend when you embed a font (I had accidently embedded a font then removed the font references so perhaps this error would not occur if the font was still available in the project?)
Removing the line below solved my problem, and the build now builds successfully.
<Import Project=”SubsetFontSilverlight.targets”>
Hope that helps someone in the future.

1 comments:

RhysC said...

can get around the dependancy issue by either A) installing all of the dependencies to the GAC on the build server or B) add a library folder to the source control of the project, add those dependecies to the library folder.

Things that are obvious for GAC should go in the gac (system libraries) pretty uch everything else should be in a "lib(rary)" folder and then is retrieved from the source control by the build server.. hth
Rhys