1

I have a branch of my application which is running with 64 bit DLLs. I have now found 32 bit equivalent DLLs of those same libraries. How do I tell MSBuild to use a certain DLL based on whether I want to build my application for a 32 bit or 64 bit platform?

I'm afraid I don't even know where to start. I've looked at perhaps using the PropertyGroup item in MSBuild, but its not making much sense...

J Doe
  • 13
  • 2

1 Answers1

0

Do you want to reference different dll (different path/name) based on your project target platform? Use condition, something like that:

<ItemGroup>
   <Reference Include="Dependency.dll" Condition="$(Platform) == 'x64'">
      <HintPath>x64\Dependency.dll</HintPath>
   </Reference>
   <Reference Include="Dependency.dll" Condition="$(Platform) == 'x86'">
      <HintPath>x86\Dependency.dll</HintPath>
   </Reference>
<ItemGroup>

See also: How do I specify the platform for MSBuild? and Active solution platform VS Project Platform VS Platform target.

abatishchev
  • 98,240
  • 88
  • 296
  • 433