Use AbstractTransactionalSpringContextTests to rollback NUnit test case automatically

I have two test cases: UserTest and CustomerTest, both of them extend the AbstractTransactionalSpringContextTests class and using the same config file, so I wrote a BaseSpringTest class:

public class BaseSpringTest : AbstractTransactionalDbProviderSpringContextTests
{
    static protected string ctxName="application_context.xml";
    static protected string[] configlocation = new string[]{"assembly://test/test.config/" + ctxName};

    protected override string[]ConfigLocations
    {
        get
        {
            return configlocation;
        }
    }
}

public class UserTest : BaseSpringTest
{
    //test case ...
}

public class CustomerTest : BaseSpringTest
{
    //test case ...
}

When I run the tests, the first one runs ok, but the second one throws an exception:

Spring.Objects.Factory.ObjectCreationException : 
        Error creating object with name 'xxxService' defined in 
        'assembly [Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], resource [test.config.Service.xml]' :
        Initialization of object failed : Duplicate type name within an assembly.

I traced into AbstractSpringContextTests class and found that it’s using a hashtable to cache the loaded context, but the hashtable isn’t a static field: Continue reading “Use AbstractTransactionalSpringContextTests to rollback NUnit test case automatically”

Could not load file or assembly ‘ADODB, Version=7.0.3300.0

Could not load file or assembly ‘ADODB, Version=7.0.3300.0

When run cc.net to build and test the web project, it throws an exception:

Could not load file or assembly 'ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

after a research on the internet, found the solution:

Copy the gacutil.exe (D:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin) to the destination pc.

Copy adodb.dll(D:\Program Files\Microsoft.NET\Primary Interop Assemblies) to the destination pc.
run gacutil /i adodb.dll to register the adodb to the gac.

Everything is ok now.