由于我在UnitTest中使用Fakes Framework,因此我收到以下MSBuild警告.
警告MSB3270:正在构建的项目的处理器体系结构"MSIL"与参考"DocumentServiceModel","x86"的处理器体系结构之间存在不匹配.这种不匹配可能会导致运行时故障.请考虑通过Configuration Manager更改项目的目标处理器体系结构,以便在项目和引用之间调整处理器体系结构,或者依赖于具有与项目的目标处理器体系结构相匹配的处理器体系结构的引用.[C:\ Projekte\XXX\XXX\XXX \源\测试\ UT\XXX.UnitTest\OBJ \调试\伪造品\ PPSM\f.csproj]
解决方案中所有项目的平台目标设置为x86.
我怎样才能摆脱这个构建警告?
UPDATE1:
我认为问题是,Fakes Framework创建了一个动态项目,平台目标为"任何CPU".
(C:\ Projekte\XXX\XXX\XXX \源\测试\ UT\XXX.UnitTest\OBJ \调试\伪造品\ PPSM\f.csproj)
这个动态项目引用了我的projekt中的程序集,它使用平台目标"x86"运行.
我不知道,如何将动态Fakes projekt改为"x86".
UPDATE2:
我创建了一个示例项目,并得到相同的警告:
Warning 1 There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "MSBErrorTest", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project …Run Code Online (Sandbox Code Playgroud)