I'm one of those people who love the Edit and Continue in VS. Because of that I develop apps in 32-bit. But when I run a unit test in debug mode and I try to edit a line, I get the usual "Changes to 64-bit applications are not allowed." message. All my components are marked x86, nunit is installed as a 32-bit application. My system is 64-bit.
How can I force nunit to run as a 32-bit application?
views:
46answers:
2Ok I figured it out. It was indeed the ReSharper TaskRunner that was running as 64-bit, more precisely JetBrains.ReSharper.TaskRunner.CLR4.MSIL.exe. I first created a copy of the file, made it writeable and then forced it's 32BIT flag high:
>corflags JetBrains.ReSharper.TaskRunner.clr4.msil.exe /32bit+ /force
/force because it's signed.
There are several other TaskRunner assemblies but I found this to be the one I'm using (trial and error). Might need to do the same to the others if I run into other ReSharper 64-bit related problems.
Hope this will help others solve the same issue.
For Resharper 5, you can just set the Platform Target, of the assembly you are testing, to x86 (in the IDE's Properties for that project). The new Resharper 5 test runner apparently detects that and runs the tests as 32 bit. No need to mess with corflags.