Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6630887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:28:14+00:00 2026-05-25T22:28:14+00:00

I have an MVC 3.0 app. My testing framework is nUnit 2.4.8.0. I started

  • 0

I have an MVC 3.0 app. My testing framework is nUnit 2.4.8.0. I started this code on a 32 bit machine, and recently started using a 64 bit machine. I just as recently upgraded the project to .NET 4.0.

My application runs fine – I am able to hydrate my objects from the database appropriately. The issue is when I run my integration tests.

The tests fail, and give an exception I’ve never seen before:

NHibernate.ADOException : cannot open connection
  ----> System.BadImageFormatException : An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

I’ve searched online for this exception – It’s of course a problem with nUnit, despite the NHibernate exception (remember, NHibernate allows me to hydrate and persist objects when I run the app).

I upgraded my nUnit assembly to the most recent release, version 2.5.10, and updated the reference in the project to the assembly under the ‘net-2.0’ folder of the nUnit zip file. I ran the tests again, and received the same exception.

It seems that there is some sort of 32-bit vs 64-bit conflict between assemblies, code, and the ASP.NET Development Server.

I don’t have any experience dealing with 32-bit vs 64-bit issues, so I don’t know if there are other questions on stack overflow that are relevant (the ones I’ve seen seem not to be). I have some ideas, but no answers:

  • Do I need a different nUnit assembly?
  • Do I need to change the Solution Platform setting in VS2010? (It’s currently on “Any CPU”)
  • Do I need to change build properties of my integration tests project?
  • Do I need to change configuration settings of my solution?

Unfortunately I don’t have a 32-bit machine around to test the code on at the moment. Are any of the above questions on the right path to solving this? Can you offer any guidance?

Thanks.

UPDATE:
I’m really hoping to be able to run the tests from within Visual Studio using TestDriven.NET. I don’t want to have to start using the nunit UI to run my tests.

UPDATE 2:
Sorry, I may not have been clear. I’m not yet using TestDriven.NET, what I said is that I’m hoping to use it, but I haven’t installed it yet on the new x64 machine. At this moment, I’m trying to run the tests by clicking on the visual icon inside the Visual Studio IDE, as in the image below:

nunit test fixtures

Following through with that action, the tests fail, and the dialog that pops up displays the following:

Failed tests

That is the exception that I quoted up above. There is no reference to assemblies that haven’t loaded.

At first I didn’t believe that the version of NHibernate (2.0.1.4000) I am using would matter; I say this because the providers are able to return the desired objects from the database when the app is run. However, When I debug the test, I see that the exception is being thrown in my provider. When digging down a bit, It seems the source of this is my SQLite assembly. But again, this is the same assembly that works when I run the project – why would it not work when I run the integration tests?

exception details

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T22:28:15+00:00Added an answer on May 25, 2026 at 10:28 pm

    This is a problem I get regularly.

    System.Data.SQLite is a 32 or 64 bit specific assembly as it bundles a native image for SQLite inside the DLL. The NUnit test runner is trying to run it in the wrong mode i.e. a 64-bit assembly in a 32-bit test runner and it’s going bang when it tries to make a native call to the SQLite C API. Windows can’t do that.

    I suggest you standardise across all platforms on either 32-bit or 64-bit i.e. your dev environment and your deployment environment.

    An intermediate fix will be to replace the SQLite DLL with a 64-bit one as available from here: http://system.data.sqlite.org/. this may however break at deploy time at which point you will need to create a build configuration for your live environment which ships the right DLL version (32/64-bit).

    Getting NUnit to deterministically run in either 32 or 64 bit mode is a pain so I wouldn’t bother with that personally.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been using Entity Framework CTP with Code-First as in this tutorial by
I have a MVC app and using JQuery. I have anchor that I setup
I have an ASP.Net-MVC app using LinqToSql. I have a subcontracts table, a service_lines
I have an MVC 1.0 app just setup but it only shows the Index.aspx
I have this markup in an MVC app. <div id=ingredientlistdiv> <% Recipe recipe =
I have an ASP.NET MVC 3 (using Entity Framework 4.2) application that uses transactions
I have this web app that is running ASP .NET MVC 1.0 with LINQ
I'm thinking of building a small web app using the MVC framework as a
I have a simple ASP.NET MVC 3 dummy app (just learning MVC coming from
I have a MVC app using the UnitOfWork, Service Layer, Repository Pattern and EF4

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.