This is a migrated thread and some comments may be shown as answers.

Running NUnit within VS2010 on 64 bit system fails?

2 Answers 117 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Development
Top achievements
Rank 1
Development asked on 17 Jan 2011, 11:35 AM
Hello,

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=6.5.0.0, 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?

Thanks.

2 Answers, 1 is accepted

Sort by
0
Deyan Varchev
Telerik team
answered on 03 Feb 2011, 01:11 PM
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,
Deyan
the Telerik team
Browse the videos here>> to help you get started with JustCode
0
Development
Top achievements
Rank 1
answered on 09 Feb 2011, 08:38 AM
Hi Deyan,

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

Daniel
Tags
General Discussions
Asked by
Development
Top achievements
Rank 1
Answers by
Deyan Varchev
Telerik team
Development
Top achievements
Rank 1
Share this question
or