开发者

nunit problem loading exe

following situation:

  • tests.dll contains a bunch of unit tests

  • program.exe contains some to be tested classes

  • tests.dll contains tests using the classes in program.exe

  • therefore tests.dll has a reference on program.exe

  • nunit-agent.exe loads tests.dll and this then loads program.exe

--> basically in the nunit 开发者_StackOverflow社区environment program.exe is used like a dll. 'misusing' an exe as dll is possible as i just wrote a little test application that also references program.exe and uses some classes defined in there and this runs fine ...

BUT in nunit i get a BadImageFormatException as soon as tests are loaded that use code defined in program.exe

is this a bug in nunit's reflection mechanism or is there a reason for that?

thx tobi


This can happen if the .exe is compiled for x86 and you are running the tests on a 64 bit OS. If this is the case you may choose to use nunit-x86.exe for running the tests.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜