Tests fail when run through NCover but not through nunit-con

Tests fail when run through NCover but not through nunit-con

Hi,

I am using the MSBuild NCover task to do the code coverage. I am using nunit 2.2.9.

When I run the tests using the NCover task some of the tests fail, but when I run the same tests directly with the console they all pass.

Here is the output from the NCover task

###
Target NCover:
    Running NUnit and NCover
    NCover.Console v1.5.4 - Code Coverage Analysis for .NET - http://ncover.org
    Copyright (c) 2004-2005 Peter Waldschmidt


    Command: C:\Program Files\NUnit-Net-2.0 2.2.9\bin\nunit-console.exe
    Command Args:  /xml:Logs\NUnitTestReport.xml ..\Code\GatewayTest\bin\Debug\G
atewayTest.dll
    Working Directory:
    Assemblies:
    Coverage Xml: Logs\CoverageSummary.xml
    Coverage Log: Logs\NCoverLog.log

    Waiting for profiled application to connect...
    Program Output
    NUnit version 2.2.9
    Copyright (C) 2002-2003 James W. Newkirk, Michael C. Two, Alexei A. Vorontso
v, Charlie Poole.
    Copyright (C) 2000-2003 Philip Craig.
    All Rights Reserved.

    OS Version: Microsoft Windows NT 5.1.2600 Service Pack 2    .NET Version: 2.
###

Here is the output from nunit-console

##
C:\Development\Projects\DotNet\Trunk\Gateway\Code\GatewayTest\bin\Debug>nunit-co
nsole.exe GatewayTest.dll
NUnit version 2.2.9
Copyright (C) 2002-2003 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov, C
harlie Poole.
Copyright (C) 2000-2003 Philip Craig.
All Rights Reserved.

OS Version: Microsoft Windows NT 5.1.2600 Service Pack 2    .NET Version: 2.0.50
727.42

..................N..USD : 29 May 2006
DELETE FROM CurrencyHoliday WHERE currencyISOCode = 'USD' AND holidayDate = '29
May 2006'
GBP : 01 May 2006
##

The tests fail saying a connection is still open to the DB
" : System.InvalidOperationException : The connection was not closed. The connect
ion's current state is open."

Has anyone else had a similar problem, and if so how do I resolve it?

Cheers

Ian