0

I would like to keep my .csproj projet and compile two version of the dll, one for Win32 platform and the other for x64 platform.

I hit a problem because I need to use different references for each platform

For example, for the ExternalReference.dll

 <Reference Include="ExternalReference">
   <SpecificVersion>False</SpecificVersion>
   <HintPath>c:\win32_repository\ExternalReference.dll</HintPath>
 </Reference>

and for x64:

 <Reference Include="ExternalReference">
   <SpecificVersion>False</SpecificVersion>
   <HintPath>c:\x64_repository\ExternalReference.dll</HintPath>
 </Reference>

I read about the $(ReferencePath) variable, but it seems to work only in the .csproj.user file and these files doesn't live on our version control, so this is not a solution.

Do you guys have any ideas ? Could I define a custom variable in the .csproj like this:

<PropertyGroup Condition=" '$(Platform)' == 'Win32' >
   <CustomReferencePath>c:\win32_repository</CustomReferencePath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'x64' >
   <CustomReferencePath>c:\x64_repository</CustomReferencePath>
</PropertyGroup>

and then add reference like this:

<Reference Include="ExternalReference">
   <SpecificVersion>False</SpecificVersion>
   <HintPath>$(CustomReferencePath)\ExternalReference.dll</HintPath>
</Reference>

But it doesn't seem to work, am I doing something wrong ?

Baptiste Pernet
  • 3,318
  • 22
  • 47
  • .NET metadata doesn't have a dependency on bitness. What's going on what that DLL? Or is this just a matter of copying the right DLL into the build folder? – Hans Passant Jun 27 '12 at 17:50
  • Hi, I wrote on extended a software with the sofware's libraries. Some of the libraries may not be .Net, anyway, I really want to use the correct dependencies, to be consistent with the extension design we use. – Baptiste Pernet Jul 01 '12 at 12:32

1 Answers1

0

Why not simply:

<Reference Include="ExternalReference" Condition=" '$(Platform)' == 'Win32'>
  <SpecificVersion>False</SpecificVersion>
  <HintPath>c:\win32_repository\ExternalReference.dll</HintPath>
</Reference>
<Reference Include="ExternalReference" Condition=" '$(Platform)' == 'x64'>
  <SpecificVersion>False</SpecificVersion>
  <HintPath>c:\x64_repository\ExternalReference.dll</HintPath>
</Reference>
Joel Lucsy
  • 8,520
  • 1
  • 29
  • 35