Skip to content

Commit

Permalink
Nuget - Copy the x86 libs before the x64 libs for AnyCPU target
Browse files Browse the repository at this point in the history
Hopefully this resolves the issue with the VS Designer picking up the x64 ones.

Issue #2276
  • Loading branch information
amaitland committed Mar 7, 2018
1 parent 298e4c2 commit 837506d
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 30 deletions.
38 changes: 23 additions & 15 deletions NuGet/CefSharp.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,13 @@
<ItemGroup>
<CefSharpCommonBinaries32 Include="$(MSBuildThisFileDirectory)..\CefSharp\x86\*.*" />
<CefSharpCommonBinaries64 Include="$(MSBuildThisFileDirectory)..\CefSharp\x64\*.*" />
<CefSharpCommonBinariesAnyCPU Include="$(MSBuildThisFileDirectory)..\CefSharp\**\*.*" />
</ItemGroup>

<PropertyGroup>
<CefSharpTargetDir Condition=" '$(CefSharpTargetDir)' == '' "></CefSharpTargetDir>
</PropertyGroup>

<Choose>
<When Condition="'$(Platform)' == 'x64'">
<ItemGroup>
<Reference Include="CefSharp">
<HintPath>$(MSBuildThisFileDirectory)..\CefSharp\x64\CefSharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CefSharp.Core">
<HintPath>$(MSBuildThisFileDirectory)..\CefSharp\x64\CefSharp.Core.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
</When>
<When Condition="'$(Platform)' == 'AnyCPU'">
<ItemGroup>
<Reference Include="CefSharp">
Expand All @@ -33,12 +20,33 @@
<HintPath>$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<None Include="@(CefSharpCommonBinariesAnyCPU)">
<Link>$(CefSharpTargetDir)\%(RecursiveDir)%(FileName)%(Extension)</Link>
<!--
We include CefSharp and CefSharp.Core as private false then copy the files using a
None entry. The 32bit libs must be included first or VS will use the x64
ones for the VS Designer.
-->
<None Include="@(CefSharpCommonBinaries32)">
<Link>$(CefSharpTargetDir)\x86\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="@(CefSharpCommonBinaries64)">
<Link>$(CefSharpTargetDir)\x64\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</When>
<When Condition="'$(Platform)' == 'x64'">
<ItemGroup>
<Reference Include="CefSharp">
<HintPath>$(MSBuildThisFileDirectory)..\CefSharp\x64\CefSharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CefSharp.Core">
<HintPath>$(MSBuildThisFileDirectory)..\CefSharp\x64\CefSharp.Core.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
</When>
<!-- x86, Win32 and AnyCPU -->
<Otherwise>
<ItemGroup>
Expand Down
16 changes: 11 additions & 5 deletions NuGet/CefSharp.OffScreen.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
</PropertyGroup>

<ItemGroup>
<!-- Not currently used, might come in handy for someone though -->
<CefSharpOffScreenBinaries32 Include="$(MSBuildThisFileDirectory)..\CefSharp\x86\*.*" />
<!-- Not currently used, might come in handy for someone though -->
<CefSharpOffScreenBinaries64 Include="$(MSBuildThisFileDirectory)..\CefSharp\x64\*.*" />
<CefSharpOffscreenBinariesAnyCPU Include="$(MSBuildThisFileDirectory)..\CefSharp\**\*.*" />
</ItemGroup>

<Choose>
Expand All @@ -19,8 +16,17 @@
<HintPath>$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.OffScreen.dll</HintPath>
<Private>False</Private>
</Reference>
<None Include="@(CefSharpOffscreenBinariesAnyCPU)">
<Link>$(CefSharpTargetDir)\%(RecursiveDir)%(FileName)%(Extension)</Link>
<!--
We include CefSharp.OffScreen as private false then copy the files using a
None entry. The 32bit libs are included first for consistency with the WinForms
and WPF versions which is required by the VS Designer.
-->
<None Include="@(CefSharpOffScreenBinaries32)">
<Link>$(CefSharpTargetDir)\x86\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="@(CefSharpOffScreenBinaries64)">
<Link>$(CefSharpTargetDir)\x64\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
Expand Down
16 changes: 11 additions & 5 deletions NuGet/CefSharp.WinForms.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
</PropertyGroup>

<ItemGroup>
<!-- Not currently used, might come in handy for someone though -->
<CefSharpWinFormsBinaries32 Include="$(MSBuildThisFileDirectory)..\CefSharp\x86\*.*" />
<!-- Not currently used, might come in handy for someone though -->
<CefSharpWinFormsBinaries64 Include="$(MSBuildThisFileDirectory)..\CefSharp\x64\*.*" />
<CefSharpWinFormsBinariesAnyCPU Include="$(MSBuildThisFileDirectory)..\CefSharp\**\*.*" />
</ItemGroup>

<Choose>
Expand All @@ -19,8 +16,17 @@
<HintPath>$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.WinForms.dll</HintPath>
<Private>False</Private>
</Reference>
<None Include="@(CefSharpWinFormsBinariesAnyCPU)">
<Link>$(CefSharpTargetDir)\%(RecursiveDir)%(FileName)%(Extension)</Link>
<!--
We include CefSharp.WinForms as private false then copy the files using a
None entry. The 32bit libs must be included first or VS will use the x64
ones for the VS Designer.
-->
<None Include="@(CefSharpWinFormsBinaries32)">
<Link>$(CefSharpTargetDir)\x86\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="@(CefSharpWinFormsBinaries64)">
<Link>$(CefSharpTargetDir)\x64\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
Expand Down
16 changes: 11 additions & 5 deletions NuGet/CefSharp.Wpf.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
</PropertyGroup>

<ItemGroup>
<!-- Not currently used, might come in handy for someone though -->
<CefSharpWpfBinaries32 Include="$(MSBuildThisFileDirectory)..\CefSharp\x86\*.*" />
<!-- Not currently used, might come in handy for someone though -->
<CefSharpWpfBinaries64 Include="$(MSBuildThisFileDirectory)..\CefSharp\x64\*.*" />
<CefSharpWpfBinariesAnyCPU Include="$(MSBuildThisFileDirectory)..\CefSharp\**\*.*" />
</ItemGroup>

<Choose>
Expand All @@ -19,8 +16,17 @@
<HintPath>$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Wpf.dll</HintPath>
<Private>False</Private>
</Reference>
<None Include="@(CefSharpWpfBinariesAnyCPU)">
<Link>$(CefSharpTargetDir)\%(RecursiveDir)%(FileName)%(Extension)</Link>
<!--
We include CefSharp.Wpf as private false then copy the files using a
None entry. The 32bit libs must be included first or VS will use the x64
ones for the VS Designer.
-->
<None Include="@(CefSharpWpfBinaries32)">
<Link>$(CefSharpTargetDir)\x86\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="@(CefSharpWpfBinaries64)">
<Link>$(CefSharpTargetDir)\x64\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
Expand Down

0 comments on commit 837506d

Please sign in to comment.