PNUnit- 32bit/64bit NUnit launcher

72 views
Skip to first unread message

Frank

unread,
May 13, 2013, 4:26:11 PM5/13/13
to nunit-...@googlegroups.com
Hi

I've noticed that PNUnit provides a 64 bit binary as part of the install. My understanding is that it uses the NUnit agent and launcher under the covers.

 Is it possible to specify which NUnit agent and launcher- 32bit or 64bit- is used when PNUnit launches tests?

Thank you
-Frank

Frank

unread,
May 13, 2013, 5:30:58 PM5/13/13
to nunit-...@googlegroups.com
I should probably give more information

We're running into a run-time exception that occurs inside a pnunit test with:

An attempt was made to load a program with an incorrect format

These tests are tested and run fine using the x86 NUnit runner.

I think this means it has something to do with the way PNUnit is built or what it is using during runtime, similar to this:

The .NET 2.0 version of nunit.exe is built using /platform:anycpu, which causes it to be jit-compiled to 32-bit code on a 32-bit system and 64-bit code on a 64 bit system. This causes an exception when NUnit is used to test a 32-bit application on a 64-bit system. To avoid this problem, use nunit-x86.exe , which is built using /platform:x86, when testing 32-bit code on a 64-bit system.

I was wondering if pnunit also provided such an x86 version to test against.

Any advice appreciated

-Frank 

Simone Busoli

unread,
May 13, 2013, 5:42:16 PM5/13/13
to NUnit-Discuss
Where did you get PNUnit? Are you intentionally running a 64 flavor of PNUnit? If so, why?


--
You received this message because you are subscribed to the Google Groups "NUnit-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nunit-discus...@googlegroups.com.
To post to this group, send email to nunit-...@googlegroups.com.
Visit this group at http://groups.google.com/group/nunit-discuss?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Frank

unread,
May 13, 2013, 6:54:44 PM5/13/13
to nunit-...@googlegroups.com
We're using the stock 2.6.0 build 12051. It shows up as a 64 bit process in the explorer. I think it was jit compiled targeting "Any CPU." I'm new to .net so I'm not entirely sure why we see an error about an incorrect format. I do know that the test succeeds when using the nunit-x86 runner. Do you think I should try building an x86 version of the pnunit agent from source?

-Frank

Simone Busoli

unread,
May 13, 2013, 6:59:40 PM5/13/13
to NUnit-Discuss
I'm not familiar with PNUnit and don't know how it works, but the first thing I would try is force it to run as 32 bits by using the corflags utility on its executable* (/32BIT+ switch). Beware, this modifies the assembly.

*The way .NET works is that the entry assembly (that is, the executable) decides the bitness of the assemblies to load. Any CPU jits to 64 bits on a x64 machine and to 32 on x86. If you run a Any CPU assembly on a x64 machine it will not be able to load an assembly built for x86.

Simone

Frank

unread,
May 14, 2013, 2:38:27 PM5/14/13
to nunit-...@googlegroups.com
Thanks for this advice. I think we're going to rebuild NUnit with the agent and the launcher as x86 or 32-bit preferred, which solves the problem. It'd be nice in the future if, like NUnit, x86 and x64 versions are both provided with the install. Thanks again for your help.

Charlie Poole

unread,
Jul 13, 2013, 8:50:10 PM7/13/13
to NUnit-Discuss
Could you file a bug  report on this so we don't lose the idea?

Charlie
Reply all
Reply to author
Forward
0 new messages