I have a C# application that must run in x64 mode. The problem is I try to create unit tests that run methods in the x64 application and the unit test project won't even build. I get the following error when it tries to build.
Error loading C:.....inx64Debug....UnitTests.dll: Unable to load
the test container 'C:.....inx64Debug....UnitTests.dll' or one
of its dependencies. If you build your test project assembly as a 64
bit assembly, it cannot be loaded. When you build your test project
assembly, select "Any CPU" for the platform. To run your tests in 64
bit mode on a 64 bit processor, you must change your test settings in
the Hosts tab to run your tests in a 32 bit process. Error details:
Could not load file or assembly
'file:///C:.....UnitTestsinx64Debug....UnitTests.dll' or one of
its dependencies. An attempt was made to load a program with an
incorrect format.
I have tried to change the unit test to x64 and also Any CPU and still cannot get it to run. Is there any fix for this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…