Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Tests that use a transactionscope fail to run
brunomlopes
#1 Posted : Friday, May 25, 2012 6:24:20 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/25/2012(UTC)
Posts: 2

Was thanked: 1 time(s) in 1 post(s)
Hello all,

I don't seem to be able to run my integration tests.
They are nunit tests that use a transaction scope to revert the database to a known state, and all fail with the error below at [2]. Each test has a setup and teardown like [1] and the error occurs when creating the TransactionScope.

Has anyone seen anything similar? The tests run on the console runner and on the resharper runner.

Thanks,
Bruno


[1]
Code:

        [SetUp]
        public void Setup()
        {
            _TransactionScope = new TransactionScope(TransactionScopeOption.RequiresNew);
        }

        [TearDown]
        public void TearDown()
        {
            if(_TransactionScope != null)
                _TransactionScope.Dispose();
        }




[2]
SetUp : System.Configuration.ConfigurationErrorsException : An error occurred creating the configuration section handler for system.transactions/machineSettings: Could not load type 'System.e.Configuration.MachineSettingsSection' from assembly 'System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null'. (C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\machine.config line 50)
----> System.TypeLoadException : Could not load type 'System.e.Configuration.MachineSettingsSection' from assembly 'System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null'.
at System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey, Boolean& isRootDeclaredHere)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey, Boolean getLkg, Boolean checkPermission)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName)
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)
at System.Transactions.Configuration.MachineSettingsSection.GetSection()
at System.Transactions.TransactionManager.get_MachineSettings()
at System.Transactions.TransactionManager.get_MaximumTimeout()
at System.Transactions.TransactionManager.ValidateTimeout(TimeSpan transactionTimeout)
at System.Transactions.TransactionManager.get_DefaultTimeout()
at System.Transactions.CommittableTransaction..ctor()
at System.Transactions.TransactionScope..ctor(TransactionScopeOption scopeOption)
brunomlopes
#2 Posted : Friday, May 25, 2012 7:19:04 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/25/2012(UTC)
Posts: 2

Was thanked: 1 time(s) in 1 post(s)
Okay, it was an error in my machine.config that apparently didn't surface on the rest of the test runners.

I've fixed it and ncrunch runs ok :)
1 user thanked brunomlopes for this useful post.
Remco on 5/25/2012(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.032 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download