如何为多平台开发添加程序集?

时间:2013-12-11 09:44:07

标签: .net visual-studio-2010 visual-studio cpu-architecture

我正在使用x86和x64平台的单独程序集开发项目。如何将此程序集添加到visual studio项目中,以便能够编译x86和x64的解决方案,而无需替换库?

1 个答案:

答案 0 :(得分:0)

手动编辑项目文件并更改此类参考

<Reference Include="YourAssembly" Condition="'$(Configuration)' == 'Release32'">
  <HintPath>PathTo32BitAssembly\YourAssembly.dll</HintPath>
</Reference>
<Reference Include="YourAssembly" Condition="'$(Configuration)' == 'Release64'">
  <HintPath>PathTo64BitAssembly\YourAssembly.dll</HintPath>
</Reference>