nunit testing 32-bit apps on 64-bit machine

I'm trying to run nunit tests of a 32-bit assembly on a 64-bit machine. When I load the assembly (compiled with VS target platform set to x86) into nunit, I get a FileNotFound exception. The problem is that nunit is running as 64-bit. I found this post by Matevz Gacnik pointing me in the right direction to get around this problem. Here is the fix:

You can use corflags to find out what settings the nunit assembly already has:

C:\> corflags "C:\Program Files (x86)\NUnit-Net-2.0 2.2.9\bin\nunit-console.exe"

Then you can add the 32BIT flag to force it to run as 32-bit:

C:\> corflags "C:\Program Files (x86)\NUnit-Net-2.0 2.2.9\bin\nunit-console.exe" /32BIT+

See also:
CorFlags Conversion Tool at MSDN,
Explanation of CLR, platform selection, and corflags.

Technorati : , , ,

Print | posted on Thursday, December 28, 2006 9:57 AM


# re: nunit testing 32-bit apps on 64-bit machine

Left by Andrey at 4/14/2008 4:39 AM
Gravatar Thank you, that solved my problem, I lost a day with NUnit.
The fix works for the UI (nunit.exe) as well.

# Likewise

Left by David Keaveny at 6/15/2009 11:46 AM
Gravatar Yup, I was getting the same problem too, and your workaround is now part of my automated build.

# re: nunit testing 32-bit apps on 64-bit machine

Left by Ryan Wibawa at 12/16/2009 2:22 PM
Gravatar The NUnit 2.5 has nunit-console-x86.exe
Make sure you use all tools with "-x86" suffix.

Your comment:


Copyright © Lance Robinson

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski