문제

I have CruiseControl.NET (v 1.6.7981.1) set up on a Windows 7 Pro dedicated build machine. I have a VS2012 project setup to build and then run MBUnit tests using Gallio.Echo.exe. My problem is that when CC.NET runs these tests it fails on a few of them, however when I run the exact same program from the command line with the exact same parameters as those specified in the CC task on the exact same dll containing the tests, every single test passes. I can't seem to figure out what is going on. Can anyone explain why some tests might fail when CruiseControl runs them but pass when I run them? I have tried running them under the same account that the CruiseControl service runs under so I do not believe it to be a permissions issue. I even tried turning it off and on again (the machine).

CruiseControl is running as a windows service with a logon with Admin privileges. Our VS project is a .NET 4.0 desktop app but we have included a legacy project previously built for .NET 3.5, upgraded to .NET 4.0. This project references the Microsoft.Ink assembly (v 6.1.0.0) and I have confirmed that this is in the GAC on the build machine. Indeed the failing tests are testing a portion of the application that use this assembly. We plan to replace this legacy project later on but for now must live with it.

Here is the error from the test report in CruiseControl:

System.Runtime.InteropServices.COMException: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) ErrorCode: -2147418113 at Microsoft.Ink.InkOverlayClass.set_Enabled(Boolean Collecting) at Microsoft.Ink.InkPicture.set_InkEnabled(Boolean value) at in .vb:line 1201.......

Here is the (VB.NET) code where it fails

Dim inkPictureObject As New Microsoft.Ink.InkPicture()
...
inkPictureObject.InkEnabled = False
inkPictureObject.Ink = New Ink()
inkPictureObject.InkEnabled = True '<-- fails here

I can't seem to find any information about the error except this (COMException occurred: ErrorCode = -2147287036) and this (Only while running on VS 2010: COMException: Catastrophic Failure: Error Code: -2147418113) neither of which I have not found helpful since I am not assigning resources and I have no problems when I hit that line when I run the program in VS2012. The real kicker is (as previously mentioned) the tests work perfectly when I run them from the command prompt (logged in as the same user as the CruiseControl service is run under) with the same parameters as those specified in the CruiseControl config.

Gallio.Echo.exe /rnf:test-report /rt:Xml-Inline /v:Quiet "C:\My project\testAssembly.dll"

Any help would be much appreciated.

도움이 되었습니까?

해결책

Try running ccnet from the command prompt and see if the tests fail or pass. I think you just have to execute ccservice.exe.

if ccnet runs as a windows service, I could understand why this may fail. A windows service cannot* create a new window.

This Microsoft documentation http://msdn.microsoft.com/en-us/library/aa514604.aspx states that an InkPicture is a c# wrapper which creates a window to display and interaction with the picture.

The run time user interface for this control is a window with an opaque background (single color, picture background, or both) that contains opaque ink.

*A windows service that runs as system can be set to allow interaction with the desktop which permits the creation of windows. Although the support is apparently being phased but by Microsoft.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top