How to set up redirect binding using Nunit gui runner?

I am trying to run my unit tests with nHibernate 3 and fluentnHibernate. To do this, I need to configure assembly binding redirection so fluentnHibernate will work with the new version of nHibernate. I tried updating my test project app.config, however the runner testdriven.net and the runner nunit gui did not seem to read these settings.

below is my test.dll app.config file.

<configuration>
  <configSections>
    <!-- Others sections -->
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
  </configSections>
  <connectionStrings>
    <add name="Test" connectionString="Data Source=SQL2008, 1080;Initial Catalog=TestCOM;Integrated Security=True"/>
  </connectionStrings>
  <log4net>
    <appender name="GeneralLog" type="log4net.Appender.RollingFileAppender">
      <file value="Logs.txt"/>
      <appendToFile value="true"/>
      <maximumFileSize value="100KB"/>
      <rollingStyle value="Size"/>
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%d{HH:mm:ss} [%t] %-5p %c - %m%n"/>
      </layout>
    </appender>
    <logger name="NHibernate.SQL" additivity="false">
      <level value="DEBUG"/>
      <appender-ref ref="GeneralLog"/>
    </logger>
  </log4net>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <requiredRuntime version="v4.0.30319" />
  </startup>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
      <qualifyAssembly
          partialName="System.Data.SqlServerCe"
          fullName="System.Data.SqlServerCe, 
Version=3.5.1.0, Culture=neutral, 
PublicKeyToken=89845dcd8080cc91"/>
      <dependentAssembly>
        <assemblyIdentity name="NHibernate"
                          publicKeyToken="AA95F207798DFDB4"
                          culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-3.0.0.1001"
                         newVersion="3.0.0.1001"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  </configuration>

I get the following error:

TestCase 'FieldGuideTests.Service.SchemaFacts.Can_Build_SQL_Schema' failed: System.IO.FileLoadException: "NHibernate, Version = 2.1.2.4000, Culture = neutral, PublicKeyToken = aa95f207798dfdb4" . . ( HRESULT: 0x80131040)    FieldGuideService.SessionFactoryManagers.SQL_SessionFactoryManager.CreateSessionFactory()

+5

All Articles