1

I'm going to refactor a piece of overcomplicated code and I want to do it in a safe manner. In order to do it I have written an unit test. But I can't use the test because it always fails with a BadImageFormatException:

Could not load file or assembly 'XXX, Version=2.0.0.0, Culture=neutral, PublicKeyToken=ZZZ' or one of its dependencies. An attempt was made to load a program with an incorrect format.

The XXX assembly is a proxy-assembly of the COM object. It is added as a refence to the project containing the test.

Currently I use the nUnit 2.5.7.

Couldn't anyone point me how can I solve the problem please?

Thanks in advance!

Igor Soloydenko
  • 11,067
  • 11
  • 47
  • 90

1 Answers1

3

Seems that your application is running under .NET 4.0, and NUnit - under .NET 2.0

See this: NUnit isn't running Visual Studio 2010 code

Community
  • 1
  • 1
abatishchev
  • 98,240
  • 88
  • 296
  • 433