我有一个必须在 x64 模式下运行的 C# 应用程序。问题是我尝试创建在 x64 应用程序中运行方法的单元测试,但单元测试项目甚至无法构建。尝试构建时出现以下错误。
Error loading C:.....\bin\x64\Debug....UnitTests.dll: Unable to load the test container 'C:.....\bin\x64\Debug....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:.....UnitTests\bin\x64\Debug....UnitTests.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
我已尝试将单元测试更改为 x64 以及任何 CPU,但仍然无法运行。有什么解决办法吗?
最佳答案
关于c# - 如何让单元测试在 x64 平台上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5571699/