Running NUnit within VS2010 on 64 bit system fails?

Thread is closed for posting
3 posts, 0 answers
  1. Daniel
    Daniel avatar
    16 posts
    Member since:
    Oct 2007

    Posted 17 Jan 2011 Link to this post


    I'm trying to run the JustCode testrunner on my 64 bit system in combination with NUnit 2.5.3. The test are not executed but fail with the following message:

    Error message : System.BadImageFormatException : Could not load file or assembly 'CpSharing.Florin.UtilityManager, Version=, Culture=neutral, PublicKeyToken=69082be05332b7f4' or one of its dependencies. An attempt was made to load a program with an incorrect format.

    Stack Trace :    at CpSharing.Florin.UtilityManager.Tests.Unit.AttributeFinderTests.FindTypes_Default2_ReturnsSomeTypes()

    It seems the test runner is mixing up 32 and 64 bit dll's. I switched the build of my test dll from 64 ("Any CPU") to 32 bit ("x86") but running the tests keeps failing. When running the test dll in the NUnit GUI I need to use "nunit-x86.exe", not "nunit.exe". Maybe the test runner is running the wrong version of the NUnit test runner but I do not see a way to enforce either running the 32 or 64 bit version. Any ideas?

  2. Deyan Varchev
    Deyan Varchev avatar
    150 posts

    Posted 03 Feb 2011 Link to this post

    Hi Daniel,

     Thanks for reporting this problem. I've tested the scenario you describe and I cannot reproduce it locally. Do you have this problem specifically with your project or with any NUnit (i.e. some simple "Hello world") test project as well?
    If it only happens for your project then it's probably something specific in the project that causes this failure. You can try the following as a possible workaround:

    1. Switch off the "Shadow-copy assemblies being tested" option in JustCode | Options | Unit Testing.
    2. Set the Copy Local setting of the NUnit assembly references in your test project to false.
    3. Clean your test project's bin folder (delete everthing).
    4. Rebuild and try to run the tests then.

    If this does not help then we'll need some more details to try and pin-down the problem. It will be great if you can open up a support ticket and send us your Unit tests project.

    Best wishes,
    the Telerik team
    Browse the videos here>> to help you get started with JustCode
  3. Daniel
    Daniel avatar
    16 posts
    Member since:
    Oct 2007

    Posted 09 Feb 2011 Link to this post

    Hi Deyan,

    Thanks, I missed the Copy Local setting. Problem solved.

Back to Top