From 60a1e615fcd1b4211951201fb2a5f45ab2147eca Mon Sep 17 00:00:00 2001 From: amaitland Date: Fri, 17 Jun 2016 08:32:07 +1000 Subject: [PATCH] Upgrade to 3.2704.1429 - Required for following changes as cef.redist targets files have changed Update CefSharp.Common.targets so it copies the cef.redist packages Add support for Win32 target (obviously uses x86 files) Update CefSharp.Native.props to copy the files also for local builds Add AnyCPU target Add CefLoader helper class for AssemblyResolver --- .../CefSharp.BrowserSubprocess.Core.vcxproj | 4 +- .../packages.config | 2 +- CefSharp.Core/CefSharp.Core.vcxproj | 4 +- CefSharp.Core/packages.config | 2 +- CefSharp.Native.props | 20 ++++- .../CefSharp.OffScreen.Example.csproj | 6 +- CefSharp.OffScreen.Example/packages.config | 4 +- .../CefSharp.WinForms.Example.csproj | 6 +- CefSharp.WinForms.Example/packages.config | 4 +- .../CefSharp.Wpf.Example.csproj | 6 +- CefSharp.Wpf.Example/packages.config | 4 +- CefSharp/CefLoader.cs | 66 ++++++++++++++++ CefSharp/CefSharp.csproj | 1 + CefSharp3.sln | 3 + NuGet/CefSharp.Common.props | 12 +++ NuGet/CefSharp.Common.targets | 75 +++++++++++++++++-- NuGet/CefSharp.OffScreen.nuspec | 1 + NuGet/CefSharp.OffScreen.props | 6 ++ NuGet/CefSharp.OffScreen.targets | 14 ++++ NuGet/CefSharp.WinForms.nuspec | 1 + NuGet/CefSharp.WinForms.props | 6 ++ NuGet/CefSharp.WinForms.targets | 14 ++++ NuGet/CefSharp.Wpf.nuspec | 1 + NuGet/CefSharp.Wpf.props | 6 ++ NuGet/CefSharp.Wpf.targets | 14 ++++ 25 files changed, 252 insertions(+), 30 deletions(-) create mode 100644 CefSharp/CefLoader.cs create mode 100644 NuGet/CefSharp.OffScreen.targets create mode 100644 NuGet/CefSharp.WinForms.targets create mode 100644 NuGet/CefSharp.Wpf.targets diff --git a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj index 6ab794734..d439bdada 100644 --- a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj +++ b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj @@ -1,6 +1,6 @@  - + Debug @@ -67,7 +67,7 @@ - e9271c37 + bd305cd7 true diff --git a/CefSharp.BrowserSubprocess.Core/packages.config b/CefSharp.BrowserSubprocess.Core/packages.config index 02aef8d5c..c7baa9895 100644 --- a/CefSharp.BrowserSubprocess.Core/packages.config +++ b/CefSharp.BrowserSubprocess.Core/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/CefSharp.Core/CefSharp.Core.vcxproj b/CefSharp.Core/CefSharp.Core.vcxproj index 5792682b3..01d9ca954 100644 --- a/CefSharp.Core/CefSharp.Core.vcxproj +++ b/CefSharp.Core/CefSharp.Core.vcxproj @@ -1,6 +1,6 @@  - + Debug @@ -67,7 +67,7 @@ <_ProjectFileVersion>11.0.51106.1 - 2ebb2af2 + dac520a5 bin\$(Platform)\$(Configuration)\ diff --git a/CefSharp.Core/packages.config b/CefSharp.Core/packages.config index 02aef8d5c..c7baa9895 100644 --- a/CefSharp.Core/packages.config +++ b/CefSharp.Core/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/CefSharp.Native.props b/CefSharp.Native.props index 56b6b68c7..ef3fe6cb8 100644 --- a/CefSharp.Native.props +++ b/CefSharp.Native.props @@ -7,4 +7,22 @@ - + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj b/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj index 44ae24819..98425eb82 100644 --- a/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj +++ b/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj @@ -13,7 +13,7 @@ 512 - f7c3e354 + 6a989588 true @@ -94,6 +94,6 @@ - - + + \ No newline at end of file diff --git a/CefSharp.OffScreen.Example/packages.config b/CefSharp.OffScreen.Example/packages.config index 53ca60b83..0ff79b2ce 100644 --- a/CefSharp.OffScreen.Example/packages.config +++ b/CefSharp.OffScreen.Example/packages.config @@ -1,5 +1,5 @@  - - + + \ No newline at end of file diff --git a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj index 65e9f600a..a354cc69a 100644 --- a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj +++ b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj @@ -21,7 +21,7 @@ 3.5 Client - b35484a6 + 39ab83f1 x64 @@ -182,6 +182,6 @@ - - + + \ No newline at end of file diff --git a/CefSharp.WinForms.Example/packages.config b/CefSharp.WinForms.Example/packages.config index 53ca60b83..0ff79b2ce 100644 --- a/CefSharp.WinForms.Example/packages.config +++ b/CefSharp.WinForms.Example/packages.config @@ -1,5 +1,5 @@  - - + + \ No newline at end of file diff --git a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj index 62cc9912c..81f05fa60 100644 --- a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj +++ b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj @@ -21,7 +21,7 @@ 3.5 Client - e08d0872 + 73c79eb8 true @@ -180,6 +180,6 @@ - - + + \ No newline at end of file diff --git a/CefSharp.Wpf.Example/packages.config b/CefSharp.Wpf.Example/packages.config index 17fd55ecf..ccb27b621 100644 --- a/CefSharp.Wpf.Example/packages.config +++ b/CefSharp.Wpf.Example/packages.config @@ -1,7 +1,7 @@  - - + + \ No newline at end of file diff --git a/CefSharp/CefLoader.cs b/CefSharp/CefLoader.cs new file mode 100644 index 000000000..186bd2154 --- /dev/null +++ b/CefSharp/CefLoader.cs @@ -0,0 +1,66 @@ +// Copyright © 2010-2016 The CefSharp Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. + +using System; +using System.IO; +using System.Reflection; + +namespace CefSharp +{ + /// + /// Used for AnyCPU Support to resolve Assemblies and Dependencies + /// + public static class CefLoader + { + /// + /// RegisterCefSharpAssemblyResolver + /// + public static void RegisterCefSharpAssemblyResolver() + { + AppDomain.CurrentDomain.AssemblyResolve += Resolver; + } + + /// + /// UnRegisterCefSharpAssemblyResolver + /// + public static void UnRegisterCefSharpAssemblyResolver() + { + AppDomain.CurrentDomain.AssemblyResolve -= Resolver; + } + + /// + /// Helper method to map the CefSharp.BrowserSubProcess.exe file + /// based on current process bitness (x64 or x86) + /// + /// + public static string GetBrowserSubProcessPath() + { + var path = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, + Environment.Is64BitProcess ? "x64" : "x86", + "CefSharp.BrowserSubprocess.exe"); + + if(File.Exists(path)) + { + throw new FileNotFoundException("Unable to locate", path); + } + + return path; + } + + private static Assembly Resolver(object sender, ResolveEventArgs args) + { + if (args.Name.StartsWith("CefSharp")) + { + string assemblyName = args.Name.Split(new[] { ',' }, 2)[0] + ".dll"; + string archSpecificPath = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, + Environment.Is64BitProcess ? "x64" : "x86", + assemblyName); + + return File.Exists(archSpecificPath) ? Assembly.LoadFile(archSpecificPath) : null; + } + + return null; + } + } +} diff --git a/CefSharp/CefSharp.csproj b/CefSharp/CefSharp.csproj index 62a52ae37..66eca2024 100644 --- a/CefSharp/CefSharp.csproj +++ b/CefSharp/CefSharp.csproj @@ -76,6 +76,7 @@ + diff --git a/CefSharp3.sln b/CefSharp3.sln index ae87154a1..a7ee611e8 100644 --- a/CefSharp3.sln +++ b/CefSharp3.sln @@ -44,10 +44,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{A23AA466 NuGet\CefSharp.Common.targets = NuGet\CefSharp.Common.targets NuGet\CefSharp.OffScreen.nuspec = NuGet\CefSharp.OffScreen.nuspec NuGet\CefSharp.OffScreen.props = NuGet\CefSharp.OffScreen.props + NuGet\CefSharp.OffScreen.targets = NuGet\CefSharp.OffScreen.targets NuGet\CefSharp.WinForms.nuspec = NuGet\CefSharp.WinForms.nuspec NuGet\CefSharp.WinForms.props = NuGet\CefSharp.WinForms.props + NuGet\CefSharp.WinForms.targets = NuGet\CefSharp.WinForms.targets NuGet\CefSharp.Wpf.nuspec = NuGet\CefSharp.Wpf.nuspec NuGet\CefSharp.Wpf.props = NuGet\CefSharp.Wpf.props + NuGet\CefSharp.Wpf.targets = NuGet\CefSharp.Wpf.targets NuGet\Readme.txt = NuGet\Readme.txt EndProjectSection EndProject diff --git a/NuGet/CefSharp.Common.props b/NuGet/CefSharp.Common.props index 08de47cc0..4cb6f9ee4 100644 --- a/NuGet/CefSharp.Common.props +++ b/NuGet/CefSharp.Common.props @@ -3,15 +3,27 @@ $(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.dll + True $(MSBuildThisFileDirectory)..\CefSharp\x64\CefSharp.dll + True + + + $(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.dll + False $(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.dll + True $(MSBuildThisFileDirectory)..\CefSharp\x64\CefSharp.Core.dll + True + + + $(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.dll + False diff --git a/NuGet/CefSharp.Common.targets b/NuGet/CefSharp.Common.targets index 6582f092c..59760f8b3 100644 --- a/NuGet/CefSharp.Common.targets +++ b/NuGet/CefSharp.Common.targets @@ -1,14 +1,73 @@ - - - - - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/NuGet/CefSharp.OffScreen.nuspec b/NuGet/CefSharp.OffScreen.nuspec index 864ccf504..6c9833086 100644 --- a/NuGet/CefSharp.OffScreen.nuspec +++ b/NuGet/CefSharp.OffScreen.nuspec @@ -27,6 +27,7 @@ + diff --git a/NuGet/CefSharp.OffScreen.props b/NuGet/CefSharp.OffScreen.props index 05638713c..fdef91ded 100644 --- a/NuGet/CefSharp.OffScreen.props +++ b/NuGet/CefSharp.OffScreen.props @@ -3,9 +3,15 @@ $(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.OffScreen.dll + True $(MSBuildThisFileDirectory)..\CefSharp\x64\CefSharp.OffScreen.dll + True + + + $(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.OffScreen.dll + False diff --git a/NuGet/CefSharp.OffScreen.targets b/NuGet/CefSharp.OffScreen.targets new file mode 100644 index 000000000..596301c47 --- /dev/null +++ b/NuGet/CefSharp.OffScreen.targets @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/NuGet/CefSharp.WinForms.nuspec b/NuGet/CefSharp.WinForms.nuspec index df38a1c88..8819b98ff 100644 --- a/NuGet/CefSharp.WinForms.nuspec +++ b/NuGet/CefSharp.WinForms.nuspec @@ -27,6 +27,7 @@ + diff --git a/NuGet/CefSharp.WinForms.props b/NuGet/CefSharp.WinForms.props index c340077ed..d2460c124 100644 --- a/NuGet/CefSharp.WinForms.props +++ b/NuGet/CefSharp.WinForms.props @@ -3,9 +3,15 @@ $(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.WinForms.dll + True $(MSBuildThisFileDirectory)..\CefSharp\x64\CefSharp.WinForms.dll + True + + + $(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.WinForms.dll + False diff --git a/NuGet/CefSharp.WinForms.targets b/NuGet/CefSharp.WinForms.targets new file mode 100644 index 000000000..793aeb585 --- /dev/null +++ b/NuGet/CefSharp.WinForms.targets @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/NuGet/CefSharp.Wpf.nuspec b/NuGet/CefSharp.Wpf.nuspec index 1a95e9763..a1308850c 100644 --- a/NuGet/CefSharp.Wpf.nuspec +++ b/NuGet/CefSharp.Wpf.nuspec @@ -27,6 +27,7 @@ + diff --git a/NuGet/CefSharp.Wpf.props b/NuGet/CefSharp.Wpf.props index d80635b32..3724f1463 100644 --- a/NuGet/CefSharp.Wpf.props +++ b/NuGet/CefSharp.Wpf.props @@ -3,9 +3,15 @@ $(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Wpf.dll + True $(MSBuildThisFileDirectory)..\CefSharp\x64\CefSharp.Wpf.dll + True + + + $(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Wpf.dll + False diff --git a/NuGet/CefSharp.Wpf.targets b/NuGet/CefSharp.Wpf.targets new file mode 100644 index 000000000..21b6f3e41 --- /dev/null +++ b/NuGet/CefSharp.Wpf.targets @@ -0,0 +1,14 @@ + + + + + + + + + + + + + +