title: MSB3270: Mismatch between the processor architecture - Fakes Framework
body: <p>Since I use Fakes Framework in my UnitTest, I get the following MSBuild warning.</p>
  
  <blockquote>
    <p>warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "DocumentServiceModel", "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 and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. [C:\Projekte\XXX\XXX\XXX\Source\Testing\UT\XXX.UnitTest\obj\Debug\Fakes\ppsm\f.csproj]</p>
  </blockquote>
  
  <p>The platform target of all projects in the solution is set to x86.</p>
  
  <p>How can I get rid of this build warning? </p>
  
  <p><strong>UPDATE1:</strong></p>
  
  <p>I think the problem is, that the Fakes Framework creates a dynamic projekt with a platform target "Any CPU".</p>
  
  <blockquote>
    <p>(C:\Projekte\XXX\XXX\XXX\Source\Testing\UT\XXX.UnitTest\obj\Debug\Fakes\ppsm\f.csproj)</p>
  </blockquote>
  
  <p>This dynamic project references the assemblies from my projekt, which runs with a platform target "x86".</p>
  
  <p>I have no idea, how to change the dynamic Fakes projekt to "x86".</p>
  
  <p><strong>UPDATE2:</strong></p>
  
  <p>I created a sample project and I get the same warning:</p>
  
  <pre><code>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 and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. [C:\Projekte\MSBErrorTest\UnitTestProject1\obj\Debug\Fakes\msbet\f.csproj] UnitTestProject1
  </code></pre>
  
  <p>UnitTest csproj:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
        &lt;PropertyGroup&gt;
          &lt;Configuration Condition=" '$(Configuration)' == '' "&gt;Debug&lt;/Configuration&gt;
          &lt;Platform Condition=" '$(Platform)' == '' "&gt;AnyCPU&lt;/Platform&gt;
          &lt;ProjectGuid&gt;{4B14EC56-DDC7-4A16-92BA-2D2881E695D1}&lt;/ProjectGuid&gt;
          &lt;OutputType&gt;Library&lt;/OutputType&gt;
          &lt;AppDesignerFolder&gt;Properties&lt;/AppDesignerFolder&gt;
          &lt;RootNamespace&gt;UnitTestProject1&lt;/RootNamespace&gt;
          &lt;AssemblyName&gt;UnitTestProject1&lt;/AssemblyName&gt;
          &lt;TargetFrameworkVersion&gt;v4.5&lt;/TargetFrameworkVersion&gt;
          &lt;FileAlignment&gt;512&lt;/FileAlignment&gt;
          &lt;ProjectTypeGuids&gt;{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&lt;/ProjectTypeGuids&gt;
          &lt;VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''"&gt;10.0&lt;/VisualStudioVersion&gt;
          &lt;VSToolsPath Condition="'$(VSToolsPath)' == ''"&gt;$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)&lt;/VSToolsPath&gt;
          &lt;ReferencePath&gt;$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages&lt;/ReferencePath&gt;
          &lt;IsCodedUITest&gt;False&lt;/IsCodedUITest&gt;
          &lt;TestProjectType&gt;UnitTest&lt;/TestProjectType&gt;
        &lt;/PropertyGroup&gt;
        &lt;PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "&gt;
          &lt;DebugSymbols&gt;true&lt;/DebugSymbols&gt;
          &lt;DebugType&gt;full&lt;/DebugType&gt;
          &lt;Optimize&gt;false&lt;/Optimize&gt;
          &lt;OutputPath&gt;bin\Debug\&lt;/OutputPath&gt;
          &lt;DefineConstants&gt;DEBUG;TRACE&lt;/DefineConstants&gt;
          &lt;ErrorReport&gt;prompt&lt;/ErrorReport&gt;
          &lt;WarningLevel&gt;4&lt;/WarningLevel&gt;
          &lt;PlatformTarget&gt;x86&lt;/PlatformTarget&gt;
        &lt;/PropertyGroup&gt;
        &lt;PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "&gt;
          &lt;DebugType&gt;pdbonly&lt;/DebugType&gt;
          &lt;Optimize&gt;true&lt;/Optimize&gt;
          &lt;OutputPath&gt;bin\Release\&lt;/OutputPath&gt;
          &lt;DefineConstants&gt;TRACE&lt;/DefineConstants&gt;
          &lt;ErrorReport&gt;prompt&lt;/ErrorReport&gt;
          &lt;WarningLevel&gt;4&lt;/WarningLevel&gt;
          &lt;PlatformTarget&gt;x86&lt;/PlatformTarget&gt;
        &lt;/PropertyGroup&gt;
        &lt;ItemGroup&gt;
          &lt;Reference Include="Microsoft.QualityTools.Testing.Fakes, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /&gt;
          &lt;Reference Include="MSBErrorTest.Fakes"&gt;
            &lt;HintPath&gt;FakesAssemblies\MSBErrorTest.Fakes.dll&lt;/HintPath&gt;
          &lt;/Reference&gt;
          &lt;Reference Include="System" /&gt;
        &lt;/ItemGroup&gt;
        &lt;Choose&gt;
          &lt;When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'"&gt;
            &lt;ItemGroup&gt;
              &lt;Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /&gt;
            &lt;/ItemGroup&gt;
          &lt;/When&gt;
          &lt;Otherwise&gt;
            &lt;ItemGroup&gt;
              &lt;Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" /&gt;
            &lt;/ItemGroup&gt;
          &lt;/Otherwise&gt;
        &lt;/Choose&gt;
        &lt;ItemGroup&gt;
          &lt;Compile Include="UnitTest1.cs" /&gt;
          &lt;Compile Include="Properties\AssemblyInfo.cs" /&gt;
        &lt;/ItemGroup&gt;
        &lt;ItemGroup&gt;
          &lt;ProjectReference Include="..\MSBErrorTest\MSBErrorTest.csproj"&gt;
            &lt;Project&gt;{f1ae6c89-6f6a-404e-b9e2-10ee2f66942f}&lt;/Project&gt;
            &lt;Name&gt;MSBErrorTest&lt;/Name&gt;
          &lt;/ProjectReference&gt;
        &lt;/ItemGroup&gt;
        &lt;ItemGroup&gt;
          &lt;Fakes Include="Fakes\MSBErrorTest.fakes" /&gt;
        &lt;/ItemGroup&gt;
        &lt;Choose&gt;
          &lt;When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'"&gt;
            &lt;ItemGroup&gt;
              &lt;Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"&gt;
                &lt;Private&gt;False&lt;/Private&gt;
              &lt;/Reference&gt;
              &lt;Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"&gt;
                &lt;Private&gt;False&lt;/Private&gt;
              &lt;/Reference&gt;
              &lt;Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"&gt;
                &lt;Private&gt;False&lt;/Private&gt;
              &lt;/Reference&gt;
              &lt;Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"&gt;
                &lt;Private&gt;False&lt;/Private&gt;
              &lt;/Reference&gt;
            &lt;/ItemGroup&gt;
          &lt;/When&gt;
        &lt;/Choose&gt;
        &lt;Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" /&gt;
        &lt;Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /&gt;
        &lt;!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
             Other similar extension points exist, see Microsoft.Common.targets.
        &lt;Target Name="BeforeBuild"&gt;
        &lt;/Target&gt;
        &lt;Target Name="AfterBuild"&gt;
        &lt;/Target&gt;
        --&gt;
      &lt;/Project&gt;
  </code></pre>
  
  <p>ClassLib csproj:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
    &lt;Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /&gt;
    &lt;PropertyGroup&gt;
      &lt;Configuration Condition=" '$(Configuration)' == '' "&gt;Debug&lt;/Configuration&gt;
      &lt;Platform Condition=" '$(Platform)' == '' "&gt;AnyCPU&lt;/Platform&gt;
      &lt;ProjectGuid&gt;{F1AE6C89-6F6A-404E-B9E2-10EE2F66942F}&lt;/ProjectGuid&gt;
      &lt;OutputType&gt;Library&lt;/OutputType&gt;
      &lt;AppDesignerFolder&gt;Properties&lt;/AppDesignerFolder&gt;
      &lt;RootNamespace&gt;MSBErrorTest&lt;/RootNamespace&gt;
      &lt;AssemblyName&gt;MSBErrorTest&lt;/AssemblyName&gt;
      &lt;TargetFrameworkVersion&gt;v4.5&lt;/TargetFrameworkVersion&gt;
      &lt;FileAlignment&gt;512&lt;/FileAlignment&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "&gt;
      &lt;DebugSymbols&gt;true&lt;/DebugSymbols&gt;
      &lt;DebugType&gt;full&lt;/DebugType&gt;
      &lt;Optimize&gt;false&lt;/Optimize&gt;
      &lt;OutputPath&gt;bin\Debug\&lt;/OutputPath&gt;
      &lt;DefineConstants&gt;DEBUG;TRACE&lt;/DefineConstants&gt;
      &lt;ErrorReport&gt;prompt&lt;/ErrorReport&gt;
      &lt;WarningLevel&gt;4&lt;/WarningLevel&gt;
      &lt;PlatformTarget&gt;x86&lt;/PlatformTarget&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "&gt;
      &lt;DebugType&gt;pdbonly&lt;/DebugType&gt;
      &lt;Optimize&gt;true&lt;/Optimize&gt;
      &lt;OutputPath&gt;bin\Release\&lt;/OutputPath&gt;
      &lt;DefineConstants&gt;TRACE&lt;/DefineConstants&gt;
      &lt;ErrorReport&gt;prompt&lt;/ErrorReport&gt;
      &lt;WarningLevel&gt;4&lt;/WarningLevel&gt;
      &lt;PlatformTarget&gt;x86&lt;/PlatformTarget&gt;
    &lt;/PropertyGroup&gt;
    &lt;ItemGroup&gt;
      &lt;Reference Include="System" /&gt;
      &lt;Reference Include="System.Core" /&gt;
      &lt;Reference Include="System.Xml.Linq" /&gt;
      &lt;Reference Include="System.Data.DataSetExtensions" /&gt;
      &lt;Reference Include="Microsoft.CSharp" /&gt;
      &lt;Reference Include="System.Data" /&gt;
      &lt;Reference Include="System.Xml" /&gt;
    &lt;/ItemGroup&gt;
    &lt;ItemGroup&gt;
      &lt;Compile Include="Class1.cs" /&gt;
      &lt;Compile Include="Properties\AssemblyInfo.cs" /&gt;
    &lt;/ItemGroup&gt;
    &lt;Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /&gt;
    &lt;!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
         Other similar extension points exist, see Microsoft.Common.targets.
    &lt;Target Name="BeforeBuild"&gt;
    &lt;/Target&gt;
    &lt;Target Name="AfterBuild"&gt;
    &lt;/Target&gt;
    --&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p><strong>UPDATE3:</strong></p>
  
  <p>I changed my config to look like this.</p>
  
  <pre><code>  &lt;PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"&gt;
      &lt;DebugSymbols&gt;true&lt;/DebugSymbols&gt;
      &lt;OutputPath&gt;bin\x86\Debug\&lt;/OutputPath&gt;
      &lt;DefineConstants&gt;DEBUG;TRACE&lt;/DefineConstants&gt;
      &lt;DebugType&gt;full&lt;/DebugType&gt;
      &lt;PlatformTarget&gt;x86&lt;/PlatformTarget&gt;
      &lt;ErrorReport&gt;prompt&lt;/ErrorReport&gt;
      &lt;CodeAnalysisRuleSet&gt;MinimumRecommendedRules.ruleset&lt;/CodeAnalysisRuleSet&gt;
    &lt;/PropertyGroup&gt;
  </code></pre>
  
  <p>But I still get the warning</p>