MSB3270: Mismatch between the processor architecture - Fakes Framework

前端 未结 5 644
轮回少年
轮回少年 2020-12-29 04:37

Since I use Fakes Framework in my UnitTest, I get the following MSBuild warning.

warning MSB3270: There was a mismatch between the processor architect

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-29 05:09

    Did you use 3rd party libraries? If you use them, check them to see if they use the same x86 as the target processor. It is clear that the targeted processor should be the same for all of the references, not just the target of your project.

    UPDATE: Apparently this guy from Microsoft is experiencing this also. You can try to use his workaround:

    http://blogs.msdn.com/b/astebner/archive/2012/05/03/10300809.aspx

    From the blog entry, do this: Search for this "PlatformTarget" in your csproj file, and edit it to match this:

    x86
    

    Let me know if this solve your problem.

    UPDATE 2: Based on your source code of the unittest.csproj and the classlib.csproj, the configuration is still based on "AnyCPU".

    Please look for this line:

    
    

    And also this line:

    
    

    Those target platform should also be set to use x86.

    The easier way is by setting the Debug and Release by clicking "Configuration Manager..." at "Debug" combobox on Visual Studio toolbar, like in this rough illustration:

    Visual Studio 2012 Debug/Release

提交回复
热议问题