Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
549 views
in Technique[技术] by (71.8m points)

.net - Visual Studio loading the right (x86 or 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.

How do I configure my Visual Studio to load a reference when my configuration is x64 and another when my configuration is x86?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...