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 ?