2011-07-26 13 views
0

私はいくつかの外部依存関係を必要とする単体テストプロジェクトを持っています。 i386(........ \ External \ EA \ i386 \ Core.dll)とamd64(........ \ External \ EA \ amd64 \ Core.dll)の2種類があります。 。ビルドターゲットに基づいて参照パスを変更する

<ItemGroup> 
    <Reference Include="Core"> 
     <HintPath>..\..\..\..\External\EA\amd64\Core.dll</HintPath> 
    </Reference> 
    <Reference Include="Util"> 
     <HintPath>..\..\..\..\External\EA\amd64\Util.dll</HintPath> 
    </Reference> 

MSTESTは32ビットであり、私は** **のi386 \ Core.dllこれらのアセンブリのパスが........ \外部の\ EAになりたいです。言い換えれば、私はmsbuildに適切なビルドターゲットを選択するよう指示します。以下に示すように

おかげで

+0

ここをクリックしてください:http://stackoverflow.com/questions/1997268/how-to-reference-different-version-of-dll-with-msbuild – Mrchief

答えて

0

ちょうどあなたが$(プラットフォーム)に値を正確にdiscovereする必要があります、それらを含むItemGroupに、

<ItemGroup 
    Condition="'$(Platform)' == 'x64'"> 
    <Reference Include="Core"> 
     <HintPath>..\..\..\..\External\EA\amd64\Core.dll</HintPath> 
    </Reference> 
    <Reference Include="Util"> 
     <HintPath>..\..\..\..\External\EA\amd64\Util.dll</HintPath> 
    </Reference> 
</ItemGroup> 
<ItemGroup 
    Condition="'$(Platform)' == 'Win32'"> 
    <Reference Include="Core"> 
     <HintPath>..\..\..\..\External\EA\i386\Core.dll</HintPath> 
    </Reference> 
    <Reference Include="Util"> 
     <HintPath>..\..\..\..\External\EA\i386\Util.dll</HintPath> 
    </Reference> 
</ItemGroup> 

を参照に条件をつけたり、あなたプロジェクトのXMLの簡単な検査が表示されます。

関連する問題