Friday, November 18, 2005

NUnit setup for VSNET2005



I was getting this error when loading a v2.0.50727 assembly in NUnit 2.2.0:


"System.BadImageFormatException: The format of the file 'something.dll' is invalid."


After a bit of hacking around I found out how to fix it.

First you need to download and install the iteration version 2.2.3. Use that link because for some reason you won’t get there from http://www.nunit.com.

Here’s the link to download: http://nunit.com/testweb/index.php?p=download

I think they just updated the site (it was dated 11/14/05) and the web site may have not been released.

Anyways, once you get 2.2.3 installed load up the nunit-gui.exe.config file under the bin folder for nunit. Then uncomment the following section:


<startup>
<supportedRuntime version="v2.0.50727" />
<supportedRuntime version="v2.0.50215" />
<supportedRuntime version="v2.0.40607" />
<supportedRuntime version="v1.1.4322" />
<supportedRuntime version="v1.0.3705" />

<requiredRuntime version="v1.0.3705" />
</startup>



Make sure v2.0.50727 is at the top of the list.

From there you should be able to load and test VSNET2005/.NET2.0 assemblies.