Visual Studio 加载正确的(x86 或 x64)dll [英] Visual Studio loading the right (x86 or x64) dll
本文介绍了Visual Studio 加载正确的(x86 或 x64)dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在 x86 中使用 Visual Studio.我想为 x32 和 x64 构建我的应用程序.但我需要使用 sqlite .net 连接器,它有一个用于 x86 应用程序的 dll 和另一个用于 x64 应用程序的 dll.
I'm working on Visual Studio in an x86. I would like to build my application for both x32 and x64. But I need to use the sqlite .net connector which has a dll for x86 apps and another dll for x64 apps.
当我的配置为 x64 时如何配置我的 Visual Studio 以加载一个引用,而当我的配置为 x86 时如何加载另一个引用?
How do I configure my Visual Studio to load a reference when my configuration is x64 and another when my configuration is x86?
推荐答案
在你的项目文件中引用使用一个 MSBUILD 条件
in your project file in reference use an MSBUILD conditional
<Reference
Include="SomeAssembly86, Version=0.85.5.452, Culture=neutral, PublicKeyToken=41b332442f1101cc, processorArchitecture=MSIL"
Condition=" '$(Platform)' == 'AnyCPU' ">
<SpecificVersion>False</SpecificVersion>
<HintPath>....DependenciesSomeAssembly.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference
Include="SomeOtherAssembly, Version=0.85.5.999, Culture=neutral, PublicKeyToken=41b332442f1101cc, processorArchitecture=MSIL"
Condition=" '$(Platform)' == 'x64' ">
<SpecificVersion>False</SpecificVersion>
<HintPath>....DependenciesSomeOtherAssembly.dll</HintPath>
<Private>False</Private>
</Reference>
这篇关于Visual Studio 加载正确的(x86 或 x64)dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文