NUnit BadImageFormat Exception : I’m the latest in the club
Today I was trying to run a test for the first time in my New Platform VS 2005 from NUnit V2.2 and it failed. It says ‘System BadImageFormat Exception : The format of the file ‘UnitTest’ is Invalid.’
Tests similar to this ran perfectly fine in VS2003 and NUnit 2.2 for me. So I did a little bit of googling (now that this is a Dictionary term) and straight away found I’m joining a club. Some says NUnit 2.2.3 has fixed this. but I did not upgrade mine as yet. But I had another testing tool which is unlike Nunit is a Plug In ot the VS Enviorenment which is Test Driven .NET which did not complain and worked perfectly.
There was a comment at Darrell Norton’s Blog about being able to run tests directly from VS 2005. Not sure how……….need to find out. But until such time……………..its all TEST DRIVEN .NET for me.
Also find some tricks and workarounds people have tried before on the same issue here.

I Think this problem comes about because the version of the .net framework that you are using is not specified correctly. Open visual studio. select help->about visual studio. make a note of the version number of the .NET framework. Add a line into the nunit-gui.exe.config file in the section that is like this:
, obviously replacing the v2.0.50727 with whatever versioon you are running on your machine.
Worked for me, but no guarantees
Comment by sam holder — October 5, 2006 @ 10:45 am