MSB3270: Fehlanpassung zwischen der Prozessorarchitektur - Fakes Framework
Da ich Fakes Framework in meinem UnitTest, bekomme ich den folgenden MSBuild-Warnung.
Warnung MSB3270: Es war ein Konflikt zwischen Prozessorarchitektur des Projekts gebaut "MSIL" und der Prozessorarchitektur des Verweises "DocumentServiceModel", "x86". Dieses Missverhältnis verursachen runtime-Fehler. Bitte ändern Sie ggf. die gezielte Prozessorarchitektur Ihres Projekts über die Configuration Manager-so richten Sie die Prozessor-Architekturen zwischen Ihrem Projekt und Referenzen, oder eine Abhängigkeit verweisen, die mit einem Prozessor-Architektur entspricht der gezielten Prozessorarchitektur Ihres Projekts. [C:\Projekte\XXX\XXX\XXX\Source\Testing\UT\XXX.UnitTest\obj\Debug\Fakes\ppsm\f.csproj]
Die Plattform das Ziel aller Projekte in der Projektmappe festgelegt ist x86.
Wie kann ich loswerden dieser build Warnung?
UPDATE1:
Ich denke, das problem ist, dass die Fakes-Framework erstellt ein dynamisches projekt mit einer target-Plattform "Any CPU".
(C:\Projekte\XXX\XXX\XXX\Source\Testing\UT\XXX.UnitTest\obj\Debug\Fakes\ppsm\f.csproj)
Diesem dynamischen Projekt Verweise auf die Assemblys aus meinem projekt, die läuft mit einer Zielplattform "x86".
Ich habe keine Ahnung, wie ändert man die dynamische Fakes projekt "x86".
UPDATE2:
Erstellte ich ein Beispiel-Projekt und ich bekomme die gleiche Warnung:
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:
Änderte ich meine config so Aussehen.
<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>
Aber ich bekomme immer noch die Warnung
InformationsquelleAutor der Frage Snowcrack | 2013-09-16
Du musst angemeldet sein, um einen Kommentar abzugeben.
Habe ich eine Antwort von Microsoft für dieses Problem
http://connect.microsoft.com/VisualStudio/feedback/details/804933/msb3270-mismatch-between-the-processor-architecture-fakes-framework
Visual Studio 2012:
Visual Studio 2013:
Dieses Problem wurde behoben in der neuesten Version, d.h. Visual Studio 2013
InformationsquelleAutor der Antwort Snowcrack
Da bin ich immer diese Fehlermeldung nur für Fakes Baugruppen dass ich nur ausgeführt werden unit-tests auf, beschloss ich, einfach ignorieren Sie diesen Fehler. Dies kann erreicht werden, indem diese an Ihre Fakes XML:
InformationsquelleAutor der Antwort Daryl
Haben Sie 3rd-party-Bibliotheken? Wenn Sie Sie verwenden, überprüfen Sie, um zu sehen, wenn Sie verwenden die gleiche x86 als target-Prozessor.
Es ist klar, dass die gezielte Prozessor soll der gleiche sein für alle Verweise, die nicht nur das Ziel von Ihrem Projekt.
UPDATE: Anscheinend ist dieser Kerl von Microsoft ist erleben dies auch. Sie können versuchen, mit seinem Problemumgehung:
http://blogs.msdn.com/b/astebner/archive/2012/05/03/10300809.aspx
Aus der blog-Eintrag, dies zu tun:
Suche für diese "PlatformTarget" in Ihrem csproj-Datei, und Bearbeiten Sie ihn, um mit dieser:
Lassen Sie mich wissen, ob dies Ihr problem lösen.
UPDATE 2: auf Basis Ihres source-Codes der unittest.csproj und die classlib.csproj, die Konfiguration ist noch auf "AnyCPU".
Bitte suchen Sie diese Zeile:
Ist und auch diese Zeile:
Diejenigen, die Zielplattform sollte auch festgelegt werden, um die Nutzung der x86-Architektur.
Der einfachere Weg ist, indem die Debug-und Release durch einen Klick auf "Configuration Manager..." im "Debug" - combobox in Visual Studio-Symbolleiste, wie in dieser groben Darstellung:
InformationsquelleAutor der Antwort Eriawan Kusumawardhono
In Projektname.csproj-Datei entfernen
ItemGroup
Knoten, in dem festgelegt ist, processorArchitecture Attribut. Es sth;<ItemGroup>
<Reference ... , processorArchitecture=MSIL">
...
</ItemGroup>
Half mir.
InformationsquelleAutor der Antwort mazury