Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

64 Bits - Failed Tests
mdumontchuq
#1 Posted : Monday, August 27, 2012 3:23:45 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/27/2012(UTC)
Posts: 1

I have a problem with a 64 Bits DLL with Visual Studio 2010.
My tests are all SUCCESS in MSTEST, but not with NCrunch.

There is the error message :
System.BadImageFormatException: Could not load file or assembly 'file:///C:\Users\[USERNAME]\AppData\Local\NCrunch\2152\32\_ncrunchreferences\PDFNet.dll' or one of its dependencies. Tentative de chargement d’un programme de format incorrect.

If a put the Same DLL Any Cpu, all the tests are success. I Can't do a reverse. I Really must use the 64 bits DLL.

Can you send to me ALL the steps to correct the problem ?

Thanks For Your Support­.
Remco
#2 Posted : Monday, August 27, 2012 9:09:27 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,979

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi, thanks for posting!

My suspicion is that you are using a test project that has been built with a target platform of AnyCPU, testing against another project (or referenced assembly) with a target platform of x64. This would work in MSTest if you have configured the MSTest runner to use x64.

NCrunch has a project-level configuration setting inside its configuration panel that allows you to tell the test runner which processor architecture it should use when running tests within a project. It's under 'Test Settings->Use CPU Architecture'. If you set this to x64 for each of your test projects that make sue of the PDFNet.dll file, then this should solve the problem.

Alternatively, a cleaner way may be to build your test projects for the x64 platform - as with an x64 dependency in their application domain, they will never actually run under x86. NCrunch will always use the default build configuration when building a project, so if you set the default build platform for the test project(s) to x64, this should also solve the problem and will give a cleaner result.


Cheers,

Remco
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.025 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download