One of the projects I'm working on at the moment is utilising Endeca. The latest version of Endeca, v6, is built on the 64bit platform. The production environment that we are running is 64bit, however our local and development environments are using v5.1.4, which is 32bit. This becomes an issue in that when we are developing locally, or testing, we cannot return results from the Endeca engine if the solution has been built in v6. 

Previously, I was deleting/re-adding the references in each project for either v5 or v6 and then building the solution. As it happens, Visual Studio project files have a great feature of Condition statements. What I've ended up doing is the following:

- Create a new folder in your solution folder, that contains both versions of the dll's. 
- In Visual Studio, create/extend the platforms you wish to use, e.g. Debug, QA, Release, Production etc.
- Open up the web application project file (.csproj). 

<Reference Include="Endeca.Logging" Condition="'$(Configuration)'=='Debug'">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\References\dlls\Debug\Endeca.Logging.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="Endeca.Logging" Condition="'$(Configuration)'=='QA'">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\References\dlls\QA\Endeca.Logging.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="Endeca.Navigation" Condition="'$(Configuration)'=='Debug'">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\References\dlls\Debug\Endeca.Navigation.dll</HintPath>
    </Reference>
    <Reference Include="Endeca.Navigation" Condition="'$(Configuration)'=='QA'">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\References\dlls\QA\Endeca.Navigation.dll</HintPath>
    </Reference>
    <Reference Include="Endeca.Navigation.AccessControl" Condition="'$(Configuration)'=='Debug'">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\References\dlls\Debug\Endeca.Navigation.AccessControl.dll</HintPath>
    </Reference>
    <Reference Include="Endeca.Navigation.AccessControl" Condition="'$(Configuration)'=='QA'">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\References\dlls\QA\Endeca.Navigation.AccessControl.dll</HintPath>
    </Reference>
    <Reference Include="Endeca.Logging" Condition="'$(Configuration)'=='Release'">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\References\dlls\Release\Endeca.Logging.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="Endeca.Navigation" Condition="'$(Configuration)'=='Release'">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\References\dlls\Release\Endeca.Navigation.dll</HintPath>
    </Reference>
    <Reference Include="Endeca.Navigation.AccessControl" Condition="'$(Configuration)'=='Release'">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\References\dlls\Release\Endeca.Navigation.AccessControl.dll</HintPath>
    </Reference>

By using the Condition statement, I can tell the IDE that depending on which version of the site I am developing/releasing in, the references will reflect accordingly, meaning any new API functionality in V6 will build.

All that's left now is to create a simple pre-build task that copies the relevant dll into the bin folder. I have used XCOPY that uses the $(Configuration) variable as the directory that contains the dll, as both versions of the dll are the same name.

XCOPY $(SOLUTIONDIR)References\dlls\$(Configuration)\Endeca.Logging.dll $(ProjectDir)bin /Y
XCOPY $(SOLUTIONDIR)References\dlls\$(Configuration)\Endeca.Navigation.dll $(ProjectDir)bin /Y
XCOPY $(SOLUTIONDIR)References\dlls\$(Configuration)\Endeca.Navigation.AccessControl.dll $(ProjectDir)bin /Y