Building .netcf with TeamCity
OK, this actually wasn?t too bad, but here is what I had to do to get TeamCity to compile my .net Compact Framework project. Mind you, I was trying to do this without installing Visual Studio 2008 on the build server. This is spesifically about the project/solution changes you will need to make to get this to work. Once those changes are complete it turns into a standard TeamCity setup.
First: Install NETCFSetupv35.msi on your build server.
Second: from your developer machine, go to C:\Windows\Microsoft.NET\Framework\v3.5 and copy
To the same directory on your build server.
Third: in the projects in your .net cf solution, copy these files to your solutions libs folder:
C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Devices\System.Data.SqlServerCe.dll
Assuming you are using MSTest and have unit tests for your project
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.SmartDevice.UnitTestFramework.dll
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.SmartDevice.UnitTestFramework.xml
Note: about the libs folder. In the same directory of every solution that I create is a libs folder. This folder contains EVERY third-party dll that my project needs to compile that is not included with the .net Framework. Then, when I reference the dll, I do it from the libs folder. I also check that folder into source control. Now any developer that needs to compile this project will/should have everything they need to compile.
Those are all of the solution changes needed to get project to compile on build server. After those are in place TeamCity can compile your .netcf 3.5 project like any other project. I typically use the sln2008 build runner for simplicity as well.
But there is a fly in the ointment. I cannot figure out how to get TeamCity to run my MSTest tests without VS 2008 installed on the server. I am against doing that, but I might have to. Also, because of limitations with testing .net cf, the tests have to be MSTest. NUnit (et al) wont work for me.
UPDATE (July 21, 2009)
Setting up a new server, saw some new errors. Like this one:
error MSB4018: The "GetDeviceFrameworkPath" task failed unexpectedly.
This page had the fix for me:
Which was to run this registry script:
UPDATE (July 31, 2009)
Recently, on a new project, I got a new error message:
?error MSB4018: The "AddHighDPIResource" task failed unexpectedly.?
It took me a while, but I finally found the answer here:
For those of you just looking for the answer: in your project file (which is an msbuild script), add the following code:
and that fixed it for me.