views:

60

answers:

1

I'm using CruiseControl.NET with MSTest to build my Excel add-in. Some of my tests involve opening Excel, performing some operations and checking the results. This is all achieved through COM.

If I run the tests from with Visual Studio 2008, they work perfectly. However, when the tests are started by CruiseControl, the Excel process is created but just hangs. The test process will only continue if I kill the Excel process. The webdashboard then reports an error in the TestInitialize function: which basically just creates and instance of Excel and loads my XLL.

Does anybody have any idea what might be the solution to my problem? I'm using Excel 2007 on my build server.

Thanks,

Chris

A: 

This is usually because there are undisposed objects that are still lingering around. You either need to be somewhat more robust in your test clearup (think workbooks, worksheets, worksheet, range - and possibly more) or you could go for a brute force approach and kill any excel instance using the Process class as part of your TestSetUp() method.

Dave
This could be the case, but the test runs properly when run through the Visual Studio IDE (and without leaving any hanging Excel processes) - they only persist when run from CC.NET. Has anybody else seen this behaviour?
Chris Spicer