Skip to content

Commit ef03e1f

Browse files
committed
Tweak to make Visual Studio being stupid about references.
1 parent 7be08c1 commit ef03e1f

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

Rubberduck.Deployment.Build/Rubberduck.Deployment.Build.csproj

+15-13
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88
<AssemblyName>Rubberduck.Deployment.Build</AssemblyName>
99
</PropertyGroup>
1010
<Import Project="..\RubberduckBaseMetaProject.csproj" />
11-
<UsingTask
12-
TaskName="GetMSBuildBitness"
13-
TaskFactory="CodeTaskFactory"
14-
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll" >
11+
<UsingTask TaskName="GetMSBuildBitness" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
1512
<ParameterGroup>
1613
<Bitness ParameterType="System.String" Output="true" />
1714
</ParameterGroup>
@@ -42,19 +39,24 @@ else
4239
<HintPath>VisualStudioSetup\Microsoft.VisualStudio.Setup.Configuration.Interop.dll</HintPath>
4340
</Reference>
4441
</ItemGroup>
45-
<Target Name="PreBuildTask" BeforeTargets="PreBuildEvent">
42+
<Target Name="BeforeBuild">
4643
<GetMSBuildBitness>
4744
<Output PropertyName="MSBuildBitness" TaskParameter="Bitness" />
4845
</GetMSBuildBitness>
46+
<Message Text="Resolved MSBuild Bitness: $(MSBuildBitness)" Importance="high" />
47+
<ItemGroup>
48+
<Reference Remove="olewoo" />
49+
<Reference Remove="olewoo_interop" />
50+
</ItemGroup>
51+
<ItemGroup Condition="'x64'=='$(MSBuildBitness)'">
52+
<Reference Include="OleWoo\x64\olewoo.dll" />
53+
<Reference Include="OleWoo\x64\olewoo_interop.dll" />
54+
</ItemGroup>
55+
<ItemGroup Condition="'x32'=='$(MSBuildBitness)'">
56+
<Reference Include="OleWoo\x32\olewoo.dll" />
57+
<Reference Include="OleWoo\x32\olewoo_interop.dll" />
58+
</ItemGroup>
4959
</Target>
50-
<ItemGroup>
51-
<Reference Include="olewoo">
52-
<HintPath>OleWoo\$(MSBuildBitness)\olewoo.dll</HintPath>
53-
</Reference>
54-
<Reference Include="olewoo_interop">
55-
<HintPath>OleWoo\$(MSBuildBitness)\olewoo_interop.dll</HintPath>
56-
</Reference>
57-
</ItemGroup>
5860
<ItemGroup>
5961
<Folder Include="OleWoo\x64\" />
6062
<Folder Include="OleWoo\x32\" />

0 commit comments

Comments
 (0)