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 NCrunch Developer
#2726
27 Aug 2012 21:09 UTC
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
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
Edited 27 Aug 2012 21:10 UTC
Post a reply
Log in to reply.