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!

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. You're right. I just didn't see that. Thanks. I'll try to search how can I change the NUnit's runtime.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.