TeamCity - Build failed on WPF Unit Tests
I have been working today with Jeremy Millers’ ScreenBinder stuff and ran into a problem today with the tests. The tests all passed fine in Visual Studio, and with rake at the command line on my computer. The problem however came when I checked the code into source control, I got a nasty test failure message in TeamCity:
Here is the error: Test(s) failed. System.Runtime.InteropServices.COMException : The program issued a command but the command length is incorrect. (Exception from HRESULT: 0×80070018)
So I did some googling around and found there is a bug in the .NET Framework 3.5 SP1 regarding this issue. So a little more work and I found a work around. I believe this bug only pertains to WPF stuff.
Workaround
On the build agent do the following:
- Stop the TeamCity Build Agent service (Start –> Run –> services.msc –> TeamCity Build Agent –> Right Click –> Stop)
- Browse to the service file (C:\TeamCity\BuildAgent\launcher\bin)
- Right click TeamCityAgentService-windows-x86-32.exe and click Properties
- Go to the Compatibility Tab
- Click Show settings for all users
- Change the Compatibility mode to be Windows XP (Service Pack 2)
- Click OK a few times to close all the windows
- Start the TeamCity Build Agent service.
You should now have a working build with WPF unit tests. Hope this helps somebody out as I was banging my head on the wall trying to figure it out.
hi
gst44zwx9luvpis4
good luck
hi
gst44zwx9luvpis4
good luck