I was pretty excited to update my Resharper 6.0 to 6.1. I downloaded the new version as soon as I could.
Unfortunately, a little nasty regression was introduced with the unit test runner which ships with Resharper.
I got the following error message whenever I attempted to execute any tests in my unit test project.
Unit Test Runner failed to load test assembly [Content] System.BadImageFormatException: Could not load file or assembly 'AiChallenge, Version=126.96.36.199, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format. [Expanded Information] at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes) at System.Reflection.RuntimeAssembly.GetExportedTypes() at NUnit.Core.CoreExtensions.InstallAdhocExtensions(Assembly assembly) at NUnit.Core.Builders.TestAssemblyBuilder.Load(String path) at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, Boolean autoSuites) at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, String testName, Boolean autoSuites) at NUnit.Core.TestSuiteBuilder.Build(TestPackage package) at NUnit.Core.SimpleTestRunner.Load(TestPackage package) at NUnit.Core.ProxyTestRunner.Load(TestPackage package) at NUnit.Core.RemoteTestRunner.Load(TestPackage package) at JetBrains.ReSharper.UnitTestRunner .nUnit.NUnitTaskRunner.ExecuteRecursive(TaskExecutionNode node)
To fix the error, simple change your unit test assembly to target the x86 platform.
To find that configration option, follow the following steps:
- Right click on project.
- Click on “Properties”.
- Click on the “Build” tab on the right.
- There is a drop down labelled “Platform target.”
- Change that to “x86 only.”
This would mean that all your code would run in the x86 manner, which should not be a problem in most solutions. Unless you are one of those unfortunates who need to talk to libraries only compiled for the 64-bit architecture… then I suppose you will need something else to float your x64 ship, sorry :(