MSB3270:不匹配的处理器架构之间 - 假货框架假货、架构、处理器、不匹配

2023-09-03 10:54:39 作者:爱而不得

由于我在我的UnitTest使用正版正货框架,我得到以下的MSBuild警告。

  

警告MSB3270:有项目正在兴建MSIL的处理器架构和参考DocumentServiceModel,86的处理器架构之间的不匹配。这种不匹配可能会导致运行时故障。请考虑通过配置管理器更改项目的目标处理器架构,以便使其处理器架构项目和引用之间,或采取与相匹配的项目的目标处理器架构的处理器架构引用的依赖。 [C:\ Projekte \ XXX \ XXX \ XXX \来源\测试\ UT \ XXX.UnitTest \ OBJ \调试\假货\ PPSM \ f.csproj]

所有项目,在解决方案的平台目标设置为86。

我怎样才能摆脱这个版本的警告?

UPDATE1:

我觉得问题是,假货框架创建一个动态PROJEKT与目标平台任何CPU。

  

(C:\ Projekte \ XXX \ XXX \ XXX \来源\测试\ UT \ XXX.UnitTest \ OBJ \调试\假货\ PPSM \ f.csproj)

这个动态的项目从我PROJEKT,这与目标平台上运行引用该组件的x86。

我不知道,如何更改动态正版正货的Projekt为86。

UPDATE2:

我创建了一个示例项目,我也得到了同样的警告:

 警告1有项目正在兴建MSIL的处理器架构和参考MSBErrorTest,86的处理器架构之间的不匹配。这种不匹配可能会导致运行时故障。请考虑通过配置管理器更改项目的目标处理器架构,以便使其处理器架构项目和引用之间,或采取与相匹配的项目的目标处理器架构的处理器架构引用的依赖。 [C:\ Projekte \ MSBErrorTest \ UnitTestProject1 \ OBJ \调试\假货\ msbet \ f.csproj] UnitTestProject1
 

的UnitTest的csproj:

 < XML版本=1.0编码=UTF-8&GT?;
    <项目ToolsVersion =4.0DefaultTargets =生成的xmlns =htt​​p://schemas.microsoft.com/developer/msbuild/2003>
      <的PropertyGroup>
        <结构状态='$(配置)'==''>调试和LT; /结构>
        <平台条件='$(平台)'==''>值为anycpu< /平台>
        < ProjectGuid> {4B14EC56-DDC7-4A16-92BA-2D2881E695D1}< / ProjectGuid>
        <输出类型>图书馆< /输出类型>
        < AppDesignerFolder>属性< / AppDesignerFolder>
        < RootNamespace> UnitTestProject1< / RootNamespace>
        <的AssemblyName> UnitTestProject1< /的AssemblyName>
        < TargetFrameworkVersion> V4.5< / TargetFrameworkVersion>
        < FileAlignment> 512< / FileAlignment>
        <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
        &LT; VisualStudioVersion条件='$(VisualStudioVersion)'==''&GT; 10.0&LT; / VisualStudioVersion&GT;
        &LT; VSToolsPath条件='$(VSToolsPath)'==''&GT; $(MSBuildExtensionsPath32)\微软\ VisualStudio中\ V $(VisualStudioVersion)&LT; / VSToolsPath&GT;
        &LT; ReferencePath&GT; $(PROGRAMFILES)\ Common Files文件\微软共享\ VSTT \ $(VisualStudioVersion)\ UITestExtensionPackages&LT; / ReferencePath&GT;
        &LT;为codedUITest&GT;假&LT; /为codedUITest&GT;
        &LT; TestProjectType&GT;的UnitTest&LT; / TestProjectType&GT;
      &LT; /的PropertyGroup&GT;
      &LT;的PropertyGroup条件='$(配置)| $(平台)==调试|值为anycpu'&GT;
        &LT; D​​ebugSymbols&GT;真&LT; / DebugSymbols&GT;
        &LT; D​​EBUGTYPE&GT;全&LT; / DEBUGTYPE&GT;
        &LT;优化&GT;假&LT; /优化&GT;
        &LT; OutputPath&GT; BIN \调试\&LT; / OutputPath&GT;
        &LT; D​​efineConstants&GT;调试; TRACE&LT; / DefineConstants&GT;
        &LT; ErrorReport&GT;提示&LT; / ErrorReport&GT;
        &其中; WarningLevel→4&所述; / WarningLevel&GT;
        &LT; PlatformTarget&GT; 86&LT; / PlatformTarget&GT;
      &LT; /的PropertyGroup&GT;
      &LT;的PropertyGroup条件='$(配置)| $(平台)'=='发布|值为anycpu'&GT;
        &LT; D​​EBUGTYPE&GT; pdbonly&LT; / DEBUGTYPE&GT;
        &LT;优化&GT;真&LT; /优化&GT;
        &LT; OutputPath&GT; BIN \发布\&LT; / OutputPath&GT;
        &LT; D​​efineConstants&GT; TRACE&LT; / DefineConstants&GT;
        &LT; ErrorReport&GT;提示&LT; / ErrorReport&GT;
        &其中; WarningLevel→4&所述; / WarningLevel&GT;
        &LT; PlatformTarget&GT; 86&LT; / PlatformTarget&GT;
      &LT; /的PropertyGroup&GT;
      &LT; ItemGroup&GT;
        &lt;参考包括=Microsoft.QualityTools.Testing.Fakes,版本= 11.0.0.0,文化=中性公钥= b03f5f7f11d50a3a,的ProcessorArchitecture = MSIL/&GT;
        &lt;参考包含=MSBErrorTest.Fakes&GT;
          &LT; HintPath&GT; FakesAssemblies \ MSBErrorTest.Fakes.dll&LT; / HintPath&GT;
        &LT; /参考&GT;
        &lt;参考包括=系统/&GT;
      &LT; / ItemGroup&GT;
      &LT;选择&GT;
        &LT;当条件=('$(VisualStudioVersion)== '10 0.0或$(VisualStudioVersion)'=='')和'$(TargetFrameworkVersion)'=='V3.5'&GT;
          &LT; ItemGroup&GT;
            &lt;参考包括=Microsoft.VisualStudio.QualityTools.UnitTestFramework,版本= 10.1.0.0,文化=中性公钥= b03f5f7f11d50a3a,的ProcessorArchitecture = MSIL/&GT;
          &LT; / ItemGroup&GT;
        &LT; /当&GT;
        &LT;否则&GT;
          &LT; ItemGroup&GT;
            &lt;参考包括=Microsoft.VisualStudio.QualityTools.UnitTestFramework/&GT;
          &LT; / ItemGroup&GT;
        &LT; /否则&GT;
      &LT; /选择&GT;
      &LT; ItemGroup&GT;
        &LT;编译包括=的UnitTest1.cs/&GT;
        &LT;编译包括=属性\ AssemblyInfo.cs中/&GT;
      &LT; / ItemGroup&GT;
      &LT; ItemGroup&GT;
        &LT; ProjectReference包括=.. \ MSBErrorTest \ MSBErrorTest.csproj&GT;
          &LT;项目&GT; {f1ae6c89-6f6a-404E-b9e2-10ee2f66942f}&LT; /项目&GT;
          &LT;名称&gt;&MSBErrorTest LT; /名称&gt;
        &LT; / ProjectReference&GT;
      &LT; / ItemGroup&GT;
      &LT; ItemGroup&GT;
        &LT;假货包括=正版正货\ MSBErrorTest.fakes/&GT;
      &LT; / ItemGroup&GT;
      &LT;选择&GT;
        &LT;当条件='$(VisualStudioVersion)== '10 0.0'和'$(为codedUITest)'=='真'&GT;
          &LT; ItemGroup&GT;
            &lt;参考包括=Microsoft.VisualStudio.QualityTools codedUITestFramework,版本= 10.0.0.0,文化=中性公钥= b03f5f7f11d50a3a,的ProcessorArchitecture = MSIL。&GT;
              &LT;私人和GT;假&LT; /私募&GT;
            &LT; /参考&GT;
            &lt;参考包括=Microsoft.VisualStudio.TestTools.UITest.Common,版本= 10.0.0.0,文化=中性公钥= b03f5f7f11d50a3a,的ProcessorArchitecture = MSIL&GT;
              &LT;私人和GT;假&LT; /私募&GT;
            &LT; /参考&GT;
            &lt;参考包括=Microsoft.VisualStudio.TestTools.UITest.Extension,版本= 10.0.0.0,文化=中性公钥= b03f5f7f11d50a3a,的ProcessorArchitecture = MSIL&GT;
              &LT;私人和GT;假&LT; /私募&GT;
            &LT; /参考&GT;
            &lt;参考包括=Microsoft.VisualStudio.TestTools.UITesting,版本= 10.0.0.0,文化=中性公钥= b03f5f7f11d50a3a,的ProcessorArchitecture = MSIL&GT;
              &LT;私人和GT;假&LT; /私募&GT;
            &LT; /参考&GT;
          &LT; / ItemGroup&GT;
        &LT; /当&GT;
      &LT; /选择&GT;
      &LT;导入项目=$(VSToolsPath)\ TeamTest \ Microsoft.TestTools.targets条件=存在('$(VSToolsPath)\ TeamTest \ Microsoft.TestTools.targets')/&GT;
      &LT;导入项目=$(MSBuildToolsPath)\ Microsoft.CSharp.targets/&GT;
      &LT;! - 要修改你的构建过程中,添加你的任务里面下的目标之一,并取消其注释。
           其他类似的扩展点存在,请参见Microsoft.Common.targets。
      &lt;目标名称=BeforeBuild&GT;
      &LT; /目标&GT;
      &lt;目标名称=AfterBuild&GT;
      &LT; /目标&GT;
       - &GT;
    &LT; /项目&GT;
 
Spring 核心框架体系结构

CLASSLIB的csproj:

 &LT; XML版本=1.0编码=UTF-8&GT?;
&LT;项目ToolsVersion =4.0DefaultTargets =生成的xmlns =htt​​p://schemas.microsoft.com/developer/msbuild/2003&GT;
  &LT;导入项目=$(MSBuildExtensionsPath)\ $(MSBuildToolsVersion)\ Microsoft.Common.props条件=存在('$(MSBuildExtensionsPath)\ $(MSBuildToolsVersion)\ Microsoft.Common.props')/&GT;
  &LT;的PropertyGroup&GT;
    &lt;结构状态='$(配置)'==''&GT;调试和LT; /结构&gt;
    &LT;平台条件='$(平台)'==''&GT;值为anycpu&LT; /平台&GT;
    &LT; ProjectGuid&GT; {F1AE6C89-6F6A-404E-B9E2-10EE2F66942F}&LT; / ProjectGuid&GT;
    &LT;输出类型&GT;图书馆&LT; /输出类型&GT;
    &LT; AppDesignerFolder&GT;属性&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条件='$(配置)| $(平台)==调试|值为anycpu'&GT;
    &LT; D​​ebugSymbols&GT;真&LT; / DebugSymbols&GT;
    &LT; D​​EBUGTYPE&GT;全&LT; / DEBUGTYPE&GT;
    &LT;优化&GT;假&LT; /优化&GT;
    &LT; OutputPath&GT; BIN \调试\&LT; / OutputPath&GT;
    &LT; D​​efineConstants&GT;调试; TRACE&LT; / DefineConstants&GT;
    &LT; ErrorReport&GT;提示&LT; / ErrorReport&GT;
    &其中; WarningLevel→4&所述; / WarningLevel&GT;
    &LT; PlatformTarget&GT; 86&LT; / PlatformTarget&GT;
  &LT; /的PropertyGroup&GT;
  &LT;的PropertyGroup条件='$(配置)| $(平台)'=='发布|值为anycpu'&GT;
    &LT; D​​EBUGTYPE&GT; pdbonly&LT; / DEBUGTYPE&GT;
    &LT;优化&GT;真&LT; /优化&GT;
    &LT; OutputPath&GT; BIN \发布\&LT; / OutputPath&GT;
    &LT; D​​efineConstants&GT; TRACE&LT; / DefineConstants&GT;
    &LT; ErrorReport&GT;提示&LT; / ErrorReport&GT;
    &其中; WarningLevel→4&所述; / WarningLevel&GT;
    &LT; PlatformTarget&GT; 86&LT; / PlatformTarget&GT;
  &LT; /的PropertyGroup&GT;
  &LT; ItemGroup&GT;
    &lt;参考包括=系统/&GT;
    &lt;参考包括=System.Core程序/&GT;
    &lt;参考包括=System.Xml.Linq的/&GT;
    &lt;参考包括=System.Data.DataSetExtensions/&GT;
    &lt;参考包括=Microsoft.CSharp/&GT;
    &lt;参考包括=System.Data这/&GT;
    &lt;参考包括=的System.Xml/&GT;
  &LT; / ItemGroup&GT;
  &LT; ItemGroup&GT;
    &LT;编译包括=将Class1.cs/&GT;
    &LT;编译包括=属性\ AssemblyInfo.cs中/&GT;
  &LT; / ItemGroup&GT;
  &LT;导入项目=$(MSBuildToolsPath)\ Microsoft.CSharp.targets/&GT;
  &LT;! - 要修改你的构建过程中,添加你的任务里面下的目标之一,并取消其注释。
       其他类似的扩展点存在,请参见Microsoft.Common.targets。
  &lt;目标名称=BeforeBuild&GT;
  &LT; /目标&GT;
  &lt;目标名称=AfterBuild&GT;
  &LT; /目标&GT;
   - &GT;
&LT; /项目&GT;
 

UPDATE3:

我改变了我的配置看起来是这样的。

 &LT;的PropertyGroup条件='$(配置)| $(平台)==调试| 86'&GT;
    &LT; D​​ebugSymbols&GT;真&LT; / DebugSymbols&GT;
    &LT; OutputPath&GT; BIN \ 86 \调试\&LT; / OutputPath&GT;
    &LT; D​​efineConstants&GT;调试; TRACE&LT; / DefineConstants&GT;
    &LT; D​​EBUGTYPE&GT;全&LT; / DEBUGTYPE&GT;
    &LT; PlatformTarget&GT; 86&LT; / PlatformTarget&GT;
    &LT; ErrorReport&GT;提示&LT; / ErrorReport&GT;
    &LT; codeAnalysisRuleSet&GT; MinimumRecommendedRules.ruleset&LT; / codeAnalysisRuleSet&GT;
  &LT; /的PropertyGroup&GT;
 

但我仍然得到警告

解决方案

我已经得到了微软针对此问题的回应

http://connect.microsoft.com/VisualStudio/feedback/details/804933/msb3270-mismatch-between-the-processor-architecture-fakes-framework

的Visual Studio 2012:

  

在创建正版正货\ MSBErrorTestClass.fakes文件中的以下元素   在正版正货节点:

 &LT;编译&GT;
 &LT;属性名=PlatformTarget&GT; 86&LT; /性&gt;
&LT; /编译&GT;
 

的Visual Studio 2013:

此问题已得到修复在最新版本即的Visual Studio 2013

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

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]

The platform target of all projects in the solution is set to x86.

How can I get rid of this build warning?

UPDATE1:

I think the problem is, that the Fakes Framework creates a dynamic projekt with a platform target "Any CPU".

(C:\Projekte\XXX\XXX\XXX\Source\Testing\UT\XXX.UnitTest\obj\Debug\Fakes\ppsm\f.csproj)

This dynamic project references the assemblies from my projekt, which runs with a platform target "x86".

I have no idea, how to change the dynamic Fakes projekt to "x86".

UPDATE2:

I created a sample project and I get the same warning:

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

UnitTest csproj:

    <?xml version="1.0" encoding="utf-8"?>
    <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup>
        <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
        <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
        <ProjectGuid>{4B14EC56-DDC7-4A16-92BA-2D2881E695D1}</ProjectGuid>
        <OutputType>Library</OutputType>
        <AppDesignerFolder>Properties</AppDesignerFolder>
        <RootNamespace>UnitTestProject1</RootNamespace>
        <AssemblyName>UnitTestProject1</AssemblyName>
        <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
        <FileAlignment>512</FileAlignment>
        <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
        <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
        <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
        <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
        <IsCodedUITest>False</IsCodedUITest>
        <TestProjectType>UnitTest</TestProjectType>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
        <DebugSymbols>true</DebugSymbols>
        <DebugType>full</DebugType>
        <Optimize>false</Optimize>
        <OutputPath>bin\Debug\</OutputPath>
        <DefineConstants>DEBUG;TRACE</DefineConstants>
        <ErrorReport>prompt</ErrorReport>
        <WarningLevel>4</WarningLevel>
        <PlatformTarget>x86</PlatformTarget>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
        <DebugType>pdbonly</DebugType>
        <Optimize>true</Optimize>
        <OutputPath>bin\Release\</OutputPath>
        <DefineConstants>TRACE</DefineConstants>
        <ErrorReport>prompt</ErrorReport>
        <WarningLevel>4</WarningLevel>
        <PlatformTarget>x86</PlatformTarget>
      </PropertyGroup>
      <ItemGroup>
        <Reference Include="Microsoft.QualityTools.Testing.Fakes, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
        <Reference Include="MSBErrorTest.Fakes">
          <HintPath>FakesAssemblies\MSBErrorTest.Fakes.dll</HintPath>
        </Reference>
        <Reference Include="System" />
      </ItemGroup>
      <Choose>
        <When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
          <ItemGroup>
            <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
          </ItemGroup>
        </When>
        <Otherwise>
          <ItemGroup>
            <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
          </ItemGroup>
        </Otherwise>
      </Choose>
      <ItemGroup>
        <Compile Include="UnitTest1.cs" />
        <Compile Include="Properties\AssemblyInfo.cs" />
      </ItemGroup>
      <ItemGroup>
        <ProjectReference Include="..\MSBErrorTest\MSBErrorTest.csproj">
          <Project>{f1ae6c89-6f6a-404e-b9e2-10ee2f66942f}</Project>
          <Name>MSBErrorTest</Name>
        </ProjectReference>
      </ItemGroup>
      <ItemGroup>
        <Fakes Include="Fakes\MSBErrorTest.fakes" />
      </ItemGroup>
      <Choose>
        <When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
          <ItemGroup>
            <Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
              <Private>False</Private>
            </Reference>
            <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
              <Private>False</Private>
            </Reference>
            <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
              <Private>False</Private>
            </Reference>
            <Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
              <Private>False</Private>
            </Reference>
          </ItemGroup>
        </When>
      </Choose>
      <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
      <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
      <!-- 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.
      <Target Name="BeforeBuild">
      </Target>
      <Target Name="AfterBuild">
      </Target>
      -->
    </Project>

ClassLib csproj:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{F1AE6C89-6F6A-404E-B9E2-10EE2F66942F}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>MSBErrorTest</RootNamespace>
    <AssemblyName>MSBErrorTest</AssemblyName>
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <PlatformTarget>x86</PlatformTarget>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <PlatformTarget>x86</PlatformTarget>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Class1.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- 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.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>

UPDATE3:

I changed my config to look like this.

  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
    <DebugSymbols>true</DebugSymbols>
    <OutputPath>bin\x86\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <DebugType>full</DebugType>
    <PlatformTarget>x86</PlatformTarget>
    <ErrorReport>prompt</ErrorReport>
    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
  </PropertyGroup>

But I still get the warning

解决方案

I have got a response from Microsoft for this issue

http://connect.microsoft.com/VisualStudio/feedback/details/804933/msb3270-mismatch-between-the-processor-architecture-fakes-framework

Visual Studio 2012:

Create the following element in "Fakes\MSBErrorTestClass.fakes" file under 'Fakes' node:

<Compilation>
 <Property Name="PlatformTarget">x86</Property>
</Compilation>

Visual Studio 2013:

This issue has been fixed in the latest release i.e. Visual Studio 2013