From b9da39d60eadce287c2cd939fd37bc5131e89887 Mon Sep 17 00:00:00 2001 From: kpreisser Date: Sat, 11 Jul 2020 19:58:23 +0200 Subject: [PATCH 1/8] Add .NET Core 3.1 projects for CefSharp, CefSharp.Core, CefSharp.BrowserSubprocess.Core, CefSharp.WinForms, CefSharp.Wpf, CefSharp.OffScreen. Contributes to CefSharp#2796 --- .../CefBrowserWrapper.h | 2 + ...arp.BrowserSubprocess.Core.netcore.filters | 197 ++++++++++ ...arp.BrowserSubprocess.Core.netcore.vcxproj | 245 ++++++++++++ .../WcfBrowserSubprocessExecutable.h | 2 + .../WcfEnabledSubProcess.cpp | 2 + .../WcfEnabledSubProcess.h | 2 + CefSharp.Core/CefSharp.Core.netcore.vcxproj | 348 ++++++++++++++++++ .../CefSharp.Core.netcore.vcxproj.filters | 343 +++++++++++++++++ .../Internals/CefBrowserHostWrapper.cpp | 4 +- .../Internals/CefBrowserHostWrapper.h | 4 +- CefSharp.Core/Internals/CefSharpApp.h | 2 + CefSharp.Core/Internals/RenderClientAdapter.h | 2 +- CefSharp.Core/ManagedCefBrowserAdapter.cpp | 4 + CefSharp.Core/ManagedCefBrowserAdapter.h | 8 + .../CefSharp.OffScreen.netcore.csproj | 19 + CefSharp.OffScreen/ChromiumWebBrowser.cs | 1 + CefSharp.OffScreen/DefaultRenderHandler.cs | 1 + CefSharp.OffScreen/IRenderHandler.cs | 1 + .../CefSharp.WinForms.netcore.csproj | 27 ++ CefSharp.Wpf/CefSharp.Wpf.netcore.csproj | 19 + CefSharp.Wpf/ChromiumWebBrowser.cs | 1 + .../Experimental/WpfIMEKeyboardHandler.cs | 1 + CefSharp.Wpf/Internals/IMEHandler.cs | 1 + CefSharp/CefSharp.netcore.csproj | 13 + CefSharp/CefSharpSettings.cs | 4 + CefSharp/IBrowserHost.cs | 1 + CefSharp/Internals/BrowserProcessService.cs | 2 + .../Internals/BrowserProcessServiceHost.cs | 4 +- CefSharp/Internals/IBrowserProcess.cs | 12 +- CefSharp/Internals/IRenderWebBrowser.cs | 1 + .../JavascriptCallbackEndpointBehavior.cs | 2 + .../Internals/JavascriptCallbackSurrogate.cs | 2 + .../Internals/JavascriptObjectRepository.cs | 8 + CefSharp/Internals/WCFExtensions.cs | 2 + CefSharp3.netcore.sln | 107 ++++++ 35 files changed, 1387 insertions(+), 7 deletions(-) create mode 100644 CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.filters create mode 100644 CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj create mode 100644 CefSharp.Core/CefSharp.Core.netcore.vcxproj create mode 100644 CefSharp.Core/CefSharp.Core.netcore.vcxproj.filters create mode 100644 CefSharp.OffScreen/CefSharp.OffScreen.netcore.csproj create mode 100644 CefSharp.WinForms/CefSharp.WinForms.netcore.csproj create mode 100644 CefSharp.Wpf/CefSharp.Wpf.netcore.csproj create mode 100644 CefSharp/CefSharp.netcore.csproj create mode 100644 CefSharp3.netcore.sln diff --git a/CefSharp.BrowserSubprocess.Core/CefBrowserWrapper.h b/CefSharp.BrowserSubprocess.Core/CefBrowserWrapper.h index 33b226b74f..b0041e5376 100644 --- a/CefSharp.BrowserSubprocess.Core/CefBrowserWrapper.h +++ b/CefSharp.BrowserSubprocess.Core/CefBrowserWrapper.h @@ -62,8 +62,10 @@ namespace CefSharp property int BrowserId; property bool IsPopup; +#ifndef NETCOREAPP // This allows us to create the WCF proxies back to our parent process. property ChannelFactory^ ChannelFactory; +#endif // The WCF proxy to the parent process. property IBrowserProcess^ BrowserProcess; diff --git a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.filters b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.filters new file mode 100644 index 0000000000..d8aee10e1e --- /dev/null +++ b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.filters @@ -0,0 +1,197 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Header Files + + + Header Files + + + + + + + + + \ No newline at end of file diff --git a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj new file mode 100644 index 0000000000..b0d4154c08 --- /dev/null +++ b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj @@ -0,0 +1,245 @@ + + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 16.0 + {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C} + CefSharp.BrowserSubprocess.Core + CefSharpBrowserSubprocessCore + NetCoreCProj + 10.0 + netcoreapp3.1 + + + + + DynamicLibrary + true + NetCore + Unicode + + + DynamicLibrary + true + NetCore + Unicode + + + DynamicLibrary + false + NetCore + Unicode + + + DynamicLibrary + false + NetCore + Unicode + + + + + + + + + + + + + + + + + + + true + ..\CefSharp.snk + true + bin\$(Platform)\$(Configuration)\ + obj\$(Platform)\$(Configuration)\ + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + + true + ..\CefSharp.snk + true + bin\$(Platform)\$(Configuration)\ + obj\$(Platform)\$(Configuration)\ + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + + false + ..\CefSharp.snk + bin\$(Platform)\$(Configuration)\ + obj\$(Platform)\$(Configuration)\ + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + + false + ..\CefSharp.snk + bin\$(Platform)\$(Configuration)\ + obj\$(Platform)\$(Configuration)\ + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + + + Level3 + $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) + Disabled + WIN32;_DEBUG;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) + Use + true + true + + + true + libcef.lib;libcef_dll_wrapper.lib + $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion); + /ignore:4099 %(AdditionalOptions) + + + + + Level3 + $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) + Disabled + WIN32;_DEBUG;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) + Use + true + + + true + libcef.lib;libcef_dll_wrapper.lib + $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion); + /ignore:4099 %(AdditionalOptions) + + + + + Level3 + $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) + WIN32;NDEBUG;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) + Use + true + true + + + true + libcef.lib;libcef_dll_wrapper.lib + $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion) + + + + + Level3 + $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) + WIN32;NDEBUG;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) + Use + true + + + true + libcef.lib;libcef_dll_wrapper.lib + $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + + + + + + + {39E385AD-DC5C-451E-B061-09AF3EE038EB} + + + + + + + + + + + \ No newline at end of file diff --git a/CefSharp.BrowserSubprocess.Core/WcfBrowserSubprocessExecutable.h b/CefSharp.BrowserSubprocess.Core/WcfBrowserSubprocessExecutable.h index 611064842f..515995b714 100644 --- a/CefSharp.BrowserSubprocess.Core/WcfBrowserSubprocessExecutable.h +++ b/CefSharp.BrowserSubprocess.Core/WcfBrowserSubprocessExecutable.h @@ -10,6 +10,7 @@ #include "WcfEnabledSubProcess.h" #include "BrowserSubprocessExecutable.h" +#ifndef NETCOREAPP using namespace System; using namespace CefSharp::Internals; @@ -44,3 +45,4 @@ namespace CefSharp }; } } +#endif diff --git a/CefSharp.BrowserSubprocess.Core/WcfEnabledSubProcess.cpp b/CefSharp.BrowserSubprocess.Core/WcfEnabledSubProcess.cpp index ced1f83c3b..aef716ac90 100644 --- a/CefSharp.BrowserSubprocess.Core/WcfEnabledSubProcess.cpp +++ b/CefSharp.BrowserSubprocess.Core/WcfEnabledSubProcess.cpp @@ -7,6 +7,7 @@ #include "Stdafx.h" #include "WcfEnabledSubProcess.h" +#ifndef NETCOREAPP using namespace System::ServiceModel; namespace CefSharp @@ -101,3 +102,4 @@ namespace CefSharp } } } +#endif diff --git a/CefSharp.BrowserSubprocess.Core/WcfEnabledSubProcess.h b/CefSharp.BrowserSubprocess.Core/WcfEnabledSubProcess.h index ffd3ea46f7..7d58937d0a 100644 --- a/CefSharp.BrowserSubprocess.Core/WcfEnabledSubProcess.h +++ b/CefSharp.BrowserSubprocess.Core/WcfEnabledSubProcess.h @@ -2,6 +2,7 @@ // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. +#ifndef NETCOREAPP #pragma once #include "Stdafx.h" @@ -36,3 +37,4 @@ namespace CefSharp }; } } +#endif diff --git a/CefSharp.Core/CefSharp.Core.netcore.vcxproj b/CefSharp.Core/CefSharp.Core.netcore.vcxproj new file mode 100644 index 0000000000..33442873ec --- /dev/null +++ b/CefSharp.Core/CefSharp.Core.netcore.vcxproj @@ -0,0 +1,348 @@ + + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 16.0 + {7B495581-2271-4F41-9476-ACB86E8C864F} + CefSharp.Core + CefSharp + NetCoreCProj + 10.0 + netcoreapp3.1 + + + + + DynamicLibrary + Unicode + NetCore + true + + + DynamicLibrary + Unicode + NetCore + true + + + DynamicLibrary + Unicode + NetCore + + + DynamicLibrary + Unicode + NetCore + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>11.0.51106.1 + + + bin\$(Platform)\$(Configuration)\ + obj\$(Platform)\$(Configuration)\ + false + false + ..\CefSharp.snk + AllRules.ruleset + + + CefSharp.Core + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + + false + false + ..\CefSharp.snk + AllRules.ruleset + + + CefSharp.Core + bin\$(Platform)\$(Configuration)\ + obj\$(Platform)\$(Configuration)\ + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + + bin\$(Platform)\$(Configuration)\ + false + AllRules.ruleset + + + CefSharp.Core + ..\CefSharp.snk + obj\$(Platform)\$(Configuration)\ + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + + false + AllRules.ruleset + + + CefSharp.Core + ..\CefSharp.snk + bin\$(Platform)\$(Configuration)\ + obj\$(Platform)\$(Configuration)\ + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + + + Disabled + $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) + _DEBUG;_WIN32_WINNT=0x0600;WINVER=0x0600;WIN32;_WINDOWS;WIN32_LEAN_AND_MEAN;USING_CEF_SHARED;_CRT_SECURE_NO_WARNINGS;EXPORT;OS_WIN;NETCOREAPP;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Use + true + Level3 + ProgramDatabase + Stdafx.h + true + true + + + false + + + opengl32.lib;glu32.lib;libcef.lib;libcef_dll_wrapper.lib;%(AdditionalDependencies) + $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion) + false + true + true + MachineX86 + false + false + $(LinkKeyFile) + /ignore:4099 %(AdditionalOptions) + libcef.dll;%(DelayLoadDLLs) + + + + + Disabled + $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) + _DEBUG;_WIN32_WINNT=0x0600;WINVER=0x0600;WIN32;_WINDOWS;WIN32_LEAN_AND_MEAN;USING_CEF_SHARED;_CRT_SECURE_NO_WARNINGS;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Use + true + Level3 + ProgramDatabase + Stdafx.h + true + + + false + + + opengl32.lib;glu32.lib;libcef.lib;libcef_dll_wrapper.lib;%(AdditionalDependencies) + $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion) + false + true + true + false + false + $(LinkKeyFile) + + + + + $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) + _NDEBUG;_WIN32_WINNT=0x0600;WINVER=0x0600;WIN32;_WINDOWS;WIN32_LEAN_AND_MEAN;USING_CEF_SHARED;_CRT_SECURE_NO_WARNINGS;EXPORT;OS_WIN;NETCOREAPP;%(PreprocessorDefinitions) + MultiThreadedDLL + Use + Level3 + ProgramDatabase + true + true + true + + + opengl32.lib;glu32.lib;libcef.lib;libcef_dll_wrapper.lib;%(AdditionalDependencies) + LinkVerbose + $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion) + true + MachineX86 + $(LinkKeyFile) + + + + + $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) + _NDEBUG;_WIN32_WINNT=0x0600;WINVER=0x0600;WIN32;_WINDOWS;WIN32_LEAN_AND_MEAN;USING_CEF_SHARED;_CRT_SECURE_NO_WARNINGS;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) + MultiThreadedDLL + Use + Level3 + ProgramDatabase + true + true + + + opengl32.lib;glu32.lib;libcef.lib;libcef_dll_wrapper.lib;%(AdditionalDependencies) + $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion) + true + $(LinkKeyFile) + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {39E385AD-DC5C-451E-B061-09AF3EE038EB} + false + true + true + false + false + + + + + + + + + + + \ No newline at end of file diff --git a/CefSharp.Core/CefSharp.Core.netcore.vcxproj.filters b/CefSharp.Core/CefSharp.Core.netcore.vcxproj.filters new file mode 100644 index 0000000000..3f7faa36af --- /dev/null +++ b/CefSharp.Core/CefSharp.Core.netcore.vcxproj.filters @@ -0,0 +1,343 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Header Files + + + + + + + + + \ No newline at end of file diff --git a/CefSharp.Core/Internals/CefBrowserHostWrapper.cpp b/CefSharp.Core/Internals/CefBrowserHostWrapper.cpp index 966c878b97..a635bec366 100644 --- a/CefSharp.Core/Internals/CefBrowserHostWrapper.cpp +++ b/CefSharp.Core/Internals/CefBrowserHostWrapper.cpp @@ -482,7 +482,7 @@ bool CefBrowserHostWrapper::IsBackgroundHost::get() return _browserHost->IsBackgroundHost(); } -void CefBrowserHostWrapper::ImeSetComposition(String^ text, cli::array^ underlines, Nullable replacementRange, Nullable selectionRange) +void CefBrowserHostWrapper::ImeSetComposition(String^ text, cli::array^ underlines, Nullable replacementRange, Nullable selectionRange) { ThrowIfDisposed(); @@ -516,7 +516,7 @@ void CefBrowserHostWrapper::ImeSetComposition(String^ text, cli::arrayImeSetComposition(StringUtils::ToNative(text), underlinesVector, repRange, selRange); } -void CefBrowserHostWrapper::ImeCommitText(String^ text, Nullable replacementRange, int relativeCursorPos) +void CefBrowserHostWrapper::ImeCommitText(String^ text, Nullable replacementRange, int relativeCursorPos) { ThrowIfDisposed(); diff --git a/CefSharp.Core/Internals/CefBrowserHostWrapper.h b/CefSharp.Core/Internals/CefBrowserHostWrapper.h index 54219e9e78..aa7ac8f44a 100644 --- a/CefSharp.Core/Internals/CefBrowserHostWrapper.h +++ b/CefSharp.Core/Internals/CefBrowserHostWrapper.h @@ -105,8 +105,8 @@ namespace CefSharp bool get(); } - virtual void ImeSetComposition(String^ text, cli::array^ underlines, Nullable replacementRange, Nullable selectionRange); - virtual void ImeCommitText(String^ text, Nullable replacementRange, int relativeCursorPos); + virtual void ImeSetComposition(String^ text, cli::array^ underlines, Nullable replacementRange, Nullable selectionRange); + virtual void ImeCommitText(String^ text, Nullable replacementRange, int relativeCursorPos); virtual void ImeFinishComposingText(bool keepSelection); virtual void ImeCancelComposition(); diff --git a/CefSharp.Core/Internals/CefSharpApp.h b/CefSharp.Core/Internals/CefSharpApp.h index 4b0d00c3ca..dd8ee99390 100644 --- a/CefSharp.Core/Internals/CefSharpApp.h +++ b/CefSharp.Core/Internals/CefSharpApp.h @@ -75,10 +75,12 @@ namespace CefSharp virtual void OnBeforeChildProcessLaunch(CefRefPtr commandLine) OVERRIDE { +#ifndef NETCOREAPP if (CefSharpSettings::WcfEnabled) { commandLine->AppendArgument(StringUtils::ToNative(CefSharpArguments::WcfEnabledArgument)); } +#endif if (CefSharpSettings::SubprocessExitIfParentProcessClosed) { diff --git a/CefSharp.Core/Internals/RenderClientAdapter.h b/CefSharp.Core/Internals/RenderClientAdapter.h index 6563a589ab..47d8d268e6 100644 --- a/CefSharp.Core/Internals/RenderClientAdapter.h +++ b/CefSharp.Core/Internals/RenderClientAdapter.h @@ -211,7 +211,7 @@ namespace CefSharp charBounds[index] = Rect((*it).x, (*it).y, (*it).width, (*it).height); } - _renderWebBrowser->OnImeCompositionRangeChanged(Range(selectedRange.from, selectedRange.to), charBounds); + _renderWebBrowser->OnImeCompositionRangeChanged(CefSharp::Structs::Range(selectedRange.from, selectedRange.to), charBounds); } //CefAccessibilityHandler diff --git a/CefSharp.Core/ManagedCefBrowserAdapter.cpp b/CefSharp.Core/ManagedCefBrowserAdapter.cpp index 9f2de5a0a4..033c0ce4a9 100644 --- a/CefSharp.Core/ManagedCefBrowserAdapter.cpp +++ b/CefSharp.Core/ManagedCefBrowserAdapter.cpp @@ -89,6 +89,7 @@ void ManagedCefBrowserAdapter::CreateBrowser(IWindowInfo^ windowInfo, BrowserSet delete windowInfo; } +#ifndef NETCOREAPP // NOTE: This was moved out of OnAfterBrowserCreated to prevent the System.ServiceModel assembly from being loaded when WCF is not enabled. __declspec(noinline) void ManagedCefBrowserAdapter::InitializeBrowserProcessServiceHost(IBrowser^ browser) { @@ -124,6 +125,7 @@ __declspec(noinline) void ManagedCefBrowserAdapter::DisposeBrowserProcessService _browserProcessServiceHost = nullptr; } } +#endif void ManagedCefBrowserAdapter::OnAfterBrowserCreated(IBrowser^ browser) { @@ -135,10 +137,12 @@ void ManagedCefBrowserAdapter::OnAfterBrowserCreated(IBrowser^ browser) //Browser has been initialized, it's now too late to register a sync JSB object if Wcf wasn't enabled _javaScriptObjectRepository->IsBrowserInitialized = true; +#ifndef NETCOREAPP if (CefSharpSettings::WcfEnabled) { InitializeBrowserProcessServiceHost(browser); } +#endif if (_webBrowserInternal != nullptr) { diff --git a/CefSharp.Core/ManagedCefBrowserAdapter.h b/CefSharp.Core/ManagedCefBrowserAdapter.h index ad618d4873..c75d94698d 100644 --- a/CefSharp.Core/ManagedCefBrowserAdapter.h +++ b/CefSharp.Core/ManagedCefBrowserAdapter.h @@ -19,7 +19,9 @@ #include "Internals/JavascriptCallbackFactory.h" using namespace System::Diagnostics; +#ifndef NETCOREAPP using namespace System::ServiceModel; +#endif using namespace System::Threading; using namespace System::Threading::Tasks; using namespace CefSharp::ModelBinding; @@ -30,7 +32,9 @@ namespace CefSharp public ref class ManagedCefBrowserAdapter : public IBrowserAdapter { MCefRefPtr _clientAdapter; +#ifndef NETCOREAPP BrowserProcessServiceHost^ _browserProcessServiceHost; +#endif IWebBrowserInternal^ _webBrowserInternal; JavascriptObjectRepository^ _javaScriptObjectRepository; JavascriptCallbackFactory^ _javascriptCallbackFactory; @@ -40,8 +44,10 @@ namespace CefSharp private: void MethodInvocationComplete(Object^ sender, MethodInvocationCompleteArgs^ e); +#ifndef NETCOREAPP void InitializeBrowserProcessServiceHost(IBrowser^ browser); void DisposeBrowserProcessServiceHost(); +#endif internal: MCefRefPtr GetClientAdapter(); @@ -104,10 +110,12 @@ namespace CefSharp _browserWrapper = nullptr; } +#ifndef NETCOREAPP if (CefSharpSettings::WcfEnabled) { DisposeBrowserProcessServiceHost(); } +#endif _webBrowserInternal = nullptr; delete _javaScriptObjectRepository; diff --git a/CefSharp.OffScreen/CefSharp.OffScreen.netcore.csproj b/CefSharp.OffScreen/CefSharp.OffScreen.netcore.csproj new file mode 100644 index 0000000000..4f716e7eef --- /dev/null +++ b/CefSharp.OffScreen/CefSharp.OffScreen.netcore.csproj @@ -0,0 +1,19 @@ + + + + netcoreapp3.1 + CefSharp.OffScreen + CefSharp.OffScreen + true + false + true + ..\CefSharp.snk + MinimumRecommendedRules.ruleset + x86;x64 + + + + + + + \ No newline at end of file diff --git a/CefSharp.OffScreen/ChromiumWebBrowser.cs b/CefSharp.OffScreen/ChromiumWebBrowser.cs index 9c04b4de43..e42c8fee31 100644 --- a/CefSharp.OffScreen/ChromiumWebBrowser.cs +++ b/CefSharp.OffScreen/ChromiumWebBrowser.cs @@ -12,6 +12,7 @@ using CefSharp.Structs; using CefSharp.Web; using Point = System.Drawing.Point; +using Range = CefSharp.Structs.Range; using Size = System.Drawing.Size; namespace CefSharp.OffScreen diff --git a/CefSharp.OffScreen/DefaultRenderHandler.cs b/CefSharp.OffScreen/DefaultRenderHandler.cs index da27887f9c..e595904c69 100644 --- a/CefSharp.OffScreen/DefaultRenderHandler.cs +++ b/CefSharp.OffScreen/DefaultRenderHandler.cs @@ -6,6 +6,7 @@ using CefSharp.Enums; using CefSharp.Structs; using Point = System.Drawing.Point; +using Range = CefSharp.Structs.Range; using Size = System.Drawing.Size; namespace CefSharp.OffScreen diff --git a/CefSharp.OffScreen/IRenderHandler.cs b/CefSharp.OffScreen/IRenderHandler.cs index da1dfad982..a0fb327559 100644 --- a/CefSharp.OffScreen/IRenderHandler.cs +++ b/CefSharp.OffScreen/IRenderHandler.cs @@ -5,6 +5,7 @@ using System; using CefSharp.Enums; using CefSharp.Structs; +using Range = CefSharp.Structs.Range; namespace CefSharp.OffScreen { diff --git a/CefSharp.WinForms/CefSharp.WinForms.netcore.csproj b/CefSharp.WinForms/CefSharp.WinForms.netcore.csproj new file mode 100644 index 0000000000..f0bc9f1487 --- /dev/null +++ b/CefSharp.WinForms/CefSharp.WinForms.netcore.csproj @@ -0,0 +1,27 @@ + + + + netcoreapp3.1 + CefSharp.WinForms + CefSharp.WinForms + true + false + true + ..\CefSharp.snk + MinimumRecommendedRules.ruleset + x86;x64 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CefSharp.Wpf/CefSharp.Wpf.netcore.csproj b/CefSharp.Wpf/CefSharp.Wpf.netcore.csproj new file mode 100644 index 0000000000..738e6b81da --- /dev/null +++ b/CefSharp.Wpf/CefSharp.Wpf.netcore.csproj @@ -0,0 +1,19 @@ + + + + netcoreapp3.1 + CefSharp.Wpf + CefSharp.Wpf + true + false + true + ..\CefSharp.snk + MinimumRecommendedRules.ruleset + x86;x64 + + + + + + + \ No newline at end of file diff --git a/CefSharp.Wpf/ChromiumWebBrowser.cs b/CefSharp.Wpf/ChromiumWebBrowser.cs index 3d3ce28f80..da98206780 100644 --- a/CefSharp.Wpf/ChromiumWebBrowser.cs +++ b/CefSharp.Wpf/ChromiumWebBrowser.cs @@ -21,6 +21,7 @@ using Microsoft.Win32.SafeHandles; using CursorType = CefSharp.Enums.CursorType; using Point = System.Windows.Point; +using Range = CefSharp.Structs.Range; using Rect = CefSharp.Structs.Rect; using Size = System.Windows.Size; diff --git a/CefSharp.Wpf/Experimental/WpfIMEKeyboardHandler.cs b/CefSharp.Wpf/Experimental/WpfIMEKeyboardHandler.cs index eb4fa1e5a0..7aea55bfed 100644 --- a/CefSharp.Wpf/Experimental/WpfIMEKeyboardHandler.cs +++ b/CefSharp.Wpf/Experimental/WpfIMEKeyboardHandler.cs @@ -11,6 +11,7 @@ using CefSharp.Structs; using CefSharp.Wpf.Internals; using Point = System.Windows.Point; +using Range = CefSharp.Structs.Range; using Rect = CefSharp.Structs.Rect; namespace CefSharp.Wpf.Experimental diff --git a/CefSharp.Wpf/Internals/IMEHandler.cs b/CefSharp.Wpf/Internals/IMEHandler.cs index d84cabbeb2..6005d9c072 100644 --- a/CefSharp.Wpf/Internals/IMEHandler.cs +++ b/CefSharp.Wpf/Internals/IMEHandler.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Text; using CefSharp.Structs; +using Range = CefSharp.Structs.Range; namespace CefSharp.Wpf.Internals { diff --git a/CefSharp/CefSharp.netcore.csproj b/CefSharp/CefSharp.netcore.csproj new file mode 100644 index 0000000000..48fb1e1593 --- /dev/null +++ b/CefSharp/CefSharp.netcore.csproj @@ -0,0 +1,13 @@ + + + + netcoreapp3.1 + CefSharp + CefSharp + false + true + ..\CefSharp.snk + MinimumRecommendedRules.ruleset + x86;x64 + + diff --git a/CefSharp/CefSharpSettings.cs b/CefSharp/CefSharpSettings.cs index 4d4eda2922..33a2d0b7ce 100644 --- a/CefSharp/CefSharpSettings.cs +++ b/CefSharp/CefSharpSettings.cs @@ -18,7 +18,9 @@ static CefSharpSettings() { ShutdownOnExit = true; LegacyJavascriptBindingEnabled = false; +#if !NETCOREAPP WcfTimeout = TimeSpan.FromSeconds(2); +#endif SubprocessExitIfParentProcessClosed = true; } @@ -31,6 +33,7 @@ static CefSharpSettings() /// public static bool LegacyJavascriptBindingEnabled { get; set; } +#if !NETCOREAPP /// /// WCF is used by RegisterJsObject feature for Javascript Binding /// It's reccomended that anyone developing a new application use @@ -45,6 +48,7 @@ static CefSharpSettings() /// will result on Abort() being called on the WCF Channel Host /// public static TimeSpan WcfTimeout { get; set; } +#endif /// /// For the WinForms and WPF instances of ChromiumWebBrowser the relevant Application Exit event diff --git a/CefSharp/IBrowserHost.cs b/CefSharp/IBrowserHost.cs index fc0064445a..5df5dc21b9 100644 --- a/CefSharp/IBrowserHost.cs +++ b/CefSharp/IBrowserHost.cs @@ -8,6 +8,7 @@ using CefSharp.Callback; using CefSharp.Enums; using CefSharp.Structs; +using Range = CefSharp.Structs.Range; using Size = CefSharp.Structs.Size; namespace CefSharp diff --git a/CefSharp/Internals/BrowserProcessService.cs b/CefSharp/Internals/BrowserProcessService.cs index 16557c9b50..6b342949c0 100644 --- a/CefSharp/Internals/BrowserProcessService.cs +++ b/CefSharp/Internals/BrowserProcessService.cs @@ -2,6 +2,7 @@ // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. +#if !NETCOREAPP using System.ServiceModel; namespace CefSharp.Internals @@ -48,3 +49,4 @@ public BrowserProcessResponse SetProperty(long objectId, string name, object val } } } +#endif diff --git a/CefSharp/Internals/BrowserProcessServiceHost.cs b/CefSharp/Internals/BrowserProcessServiceHost.cs index 051f675440..38b7e35c5a 100644 --- a/CefSharp/Internals/BrowserProcessServiceHost.cs +++ b/CefSharp/Internals/BrowserProcessServiceHost.cs @@ -2,6 +2,7 @@ // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. +#if !NETCOREAPP using System; using System.Net.Security; using System.ServiceModel; @@ -66,4 +67,5 @@ public static CustomBinding CreateBinding() return customBinding; } } -} \ No newline at end of file +} +#endif diff --git a/CefSharp/Internals/IBrowserProcess.cs b/CefSharp/Internals/IBrowserProcess.cs index 9f7c318cb1..fed3a30bc8 100644 --- a/CefSharp/Internals/IBrowserProcess.cs +++ b/CefSharp/Internals/IBrowserProcess.cs @@ -3,10 +3,13 @@ // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. using System.Collections.Generic; +#if !NETCOREAPP using System.ServiceModel; +#endif namespace CefSharp.Internals { +#if !NETCOREAPP [ServiceContract(SessionMode = SessionMode.Required)] [ServiceKnownType(typeof(object[]))] [ServiceKnownType(typeof(Dictionary))] @@ -14,15 +17,22 @@ namespace CefSharp.Internals [ServiceKnownType(typeof(JavascriptMethod))] [ServiceKnownType(typeof(JavascriptProperty))] [ServiceKnownType(typeof(JavascriptCallback))] +#endif public interface IBrowserProcess { +#if !NETCOREAPP [OperationContract] +#endif BrowserProcessResponse CallMethod(long objectId, string name, object[] parameters); +#if !NETCOREAPP [OperationContract] +#endif BrowserProcessResponse GetProperty(long objectId, string name); +#if !NETCOREAPP [OperationContract] +#endif BrowserProcessResponse SetProperty(long objectId, string name, object value); } -} \ No newline at end of file +} diff --git a/CefSharp/Internals/IRenderWebBrowser.cs b/CefSharp/Internals/IRenderWebBrowser.cs index d604ebe1fa..93e0309224 100644 --- a/CefSharp/Internals/IRenderWebBrowser.cs +++ b/CefSharp/Internals/IRenderWebBrowser.cs @@ -5,6 +5,7 @@ using System; using CefSharp.Enums; using CefSharp.Structs; +using Range = CefSharp.Structs.Range; namespace CefSharp.Internals { diff --git a/CefSharp/Internals/JavascriptCallbackEndpointBehavior.cs b/CefSharp/Internals/JavascriptCallbackEndpointBehavior.cs index 80dec1bc45..1c50a56efe 100644 --- a/CefSharp/Internals/JavascriptCallbackEndpointBehavior.cs +++ b/CefSharp/Internals/JavascriptCallbackEndpointBehavior.cs @@ -2,6 +2,7 @@ // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. +#if !NETCOREAPP using System.Collections.Generic; using System.Linq; using System.ServiceModel.Channels; @@ -46,3 +47,4 @@ public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRu } } } +#endif diff --git a/CefSharp/Internals/JavascriptCallbackSurrogate.cs b/CefSharp/Internals/JavascriptCallbackSurrogate.cs index 84ed3f15dc..7a7c8a6432 100644 --- a/CefSharp/Internals/JavascriptCallbackSurrogate.cs +++ b/CefSharp/Internals/JavascriptCallbackSurrogate.cs @@ -2,6 +2,7 @@ // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. +#if !NETCOREAPP using System; using System.CodeDom; using System.Collections.ObjectModel; @@ -70,3 +71,4 @@ public CodeTypeDeclaration ProcessImportedType(CodeTypeDeclaration typeDeclarati } } } +#endif diff --git a/CefSharp/Internals/JavascriptObjectRepository.cs b/CefSharp/Internals/JavascriptObjectRepository.cs index 4c3f8d75f0..b38fc115f9 100644 --- a/CefSharp/Internals/JavascriptObjectRepository.cs +++ b/CefSharp/Internals/JavascriptObjectRepository.cs @@ -165,6 +165,7 @@ public void Register(string name, object value, bool isAsync, BindingOptions opt throw new ArgumentNullException("value"); } +#if !NETCOREAPP //Enable WCF if not already enabled - can only be done before the browser has been initliazed //if done after the subprocess won't be WCF enabled it we'll have to throw an exception if (!IsBrowserInitialized && !isAsync) @@ -177,6 +178,13 @@ public void Register(string name, object value, bool isAsync, BindingOptions opt throw new InvalidOperationException(@"To enable synchronous JS bindings set WcfEnabled true in CefSharpSettings before you create your ChromiumWebBrowser instances."); } +#else + // WCF is not available on .NET Core. + if (!isAsync) + { + throw new NotSupportedException("Synchronous JS bindings are not supported."); + } +#endif //Validation name is unique if (objects.Values.Count(x => string.Equals(x.Name, name, StringComparison.OrdinalIgnoreCase)) > 0) diff --git a/CefSharp/Internals/WCFExtensions.cs b/CefSharp/Internals/WCFExtensions.cs index 3281aaed98..addeccc330 100644 --- a/CefSharp/Internals/WCFExtensions.cs +++ b/CefSharp/Internals/WCFExtensions.cs @@ -2,6 +2,7 @@ // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. +#if !NETCOREAPP using System; using System.ServiceModel.Description; @@ -52,3 +53,4 @@ public static void ApplyServiceBehavior(this ServiceDescription description, } } } +#endif diff --git a/CefSharp3.netcore.sln b/CefSharp3.netcore.sln new file mode 100644 index 0000000000..9b09e491d2 --- /dev/null +++ b/CefSharp3.netcore.sln @@ -0,0 +1,107 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30223.230 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CefSharp.netcore", "CefSharp\CefSharp.netcore.csproj", "{39E385AD-DC5C-451E-B061-09AF3EE038EB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CefSharp.Core.netcore", "CefSharp.Core\CefSharp.Core.netcore.vcxproj", "{7B495581-2271-4F41-9476-ACB86E8C864F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CefSharp.BrowserSubprocess.Core.netcore", "CefSharp.BrowserSubprocess.Core\CefSharp.BrowserSubprocess.Core.netcore.vcxproj", "{6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CefSharp.WinForms.netcore", "CefSharp.WinForms\CefSharp.WinForms.netcore.csproj", "{B91EB129-F892-402C-AF08-F3E1D5B80B09}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CefSharp.Wpf.netcore", "CefSharp.Wpf\CefSharp.Wpf.netcore.csproj", "{99A1985B-2C79-4DE5-A0AD-0513647B9737}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CefSharp.OffScreen.netcore", "CefSharp.OffScreen\CefSharp.OffScreen.netcore.csproj", "{6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{47D0DC8C-D707-4D8A-A578-7737AA9CE79B}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + appveyor.yml = appveyor.yml + CefSharp.Native.props = CefSharp.Native.props + CefSharp.props = CefSharp.props + CONTRIBUTING.md = CONTRIBUTING.md + ISSUE_TEMPLATE.md = ISSUE_TEMPLATE.md + LICENSE = LICENSE + README.md = README.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{A23AA466-1903-44F2-946D-25AD0500D56B}" + ProjectSection(SolutionItems) = preProject + NuGet\CefSharp.Common.nuspec = NuGet\CefSharp.Common.nuspec + NuGet\CefSharp.Common.props = NuGet\CefSharp.Common.props + 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.WinForms.nuspec = NuGet\CefSharp.WinForms.nuspec + NuGet\CefSharp.WinForms.props = NuGet\CefSharp.WinForms.props + NuGet\CefSharp.Wpf.nuspec = NuGet\CefSharp.Wpf.nuspec + NuGet\CefSharp.Wpf.props = NuGet\CefSharp.Wpf.props + NuGet\Readme.txt = NuGet\Readme.txt + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Debug|x64.ActiveCfg = Debug|x64 + {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Debug|x64.Build.0 = Debug|x64 + {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Debug|x86.ActiveCfg = Debug|x86 + {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Debug|x86.Build.0 = Debug|x86 + {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Release|x64.ActiveCfg = Release|x64 + {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Release|x64.Build.0 = Release|x64 + {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Release|x86.ActiveCfg = Release|x86 + {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Release|x86.Build.0 = Release|x86 + {7B495581-2271-4F41-9476-ACB86E8C864F}.Debug|x64.ActiveCfg = Debug|x64 + {7B495581-2271-4F41-9476-ACB86E8C864F}.Debug|x64.Build.0 = Debug|x64 + {7B495581-2271-4F41-9476-ACB86E8C864F}.Debug|x86.ActiveCfg = Debug|Win32 + {7B495581-2271-4F41-9476-ACB86E8C864F}.Debug|x86.Build.0 = Debug|Win32 + {7B495581-2271-4F41-9476-ACB86E8C864F}.Release|x64.ActiveCfg = Release|x64 + {7B495581-2271-4F41-9476-ACB86E8C864F}.Release|x64.Build.0 = Release|x64 + {7B495581-2271-4F41-9476-ACB86E8C864F}.Release|x86.ActiveCfg = Release|Win32 + {7B495581-2271-4F41-9476-ACB86E8C864F}.Release|x86.Build.0 = Release|Win32 + {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Debug|x64.ActiveCfg = Debug|x64 + {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Debug|x64.Build.0 = Debug|x64 + {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Debug|x86.ActiveCfg = Debug|Win32 + {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Debug|x86.Build.0 = Debug|Win32 + {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Release|x64.ActiveCfg = Release|x64 + {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Release|x64.Build.0 = Release|x64 + {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Release|x86.ActiveCfg = Release|Win32 + {6C4BB501-2F8E-48AC-9AB5-8CFB2D74185C}.Release|x86.Build.0 = Release|Win32 + {B91EB129-F892-402C-AF08-F3E1D5B80B09}.Debug|x64.ActiveCfg = Debug|x64 + {B91EB129-F892-402C-AF08-F3E1D5B80B09}.Debug|x64.Build.0 = Debug|x64 + {B91EB129-F892-402C-AF08-F3E1D5B80B09}.Debug|x86.ActiveCfg = Debug|x86 + {B91EB129-F892-402C-AF08-F3E1D5B80B09}.Debug|x86.Build.0 = Debug|x86 + {B91EB129-F892-402C-AF08-F3E1D5B80B09}.Release|x64.ActiveCfg = Release|x64 + {B91EB129-F892-402C-AF08-F3E1D5B80B09}.Release|x64.Build.0 = Release|x64 + {B91EB129-F892-402C-AF08-F3E1D5B80B09}.Release|x86.ActiveCfg = Release|x86 + {B91EB129-F892-402C-AF08-F3E1D5B80B09}.Release|x86.Build.0 = Release|x86 + {99A1985B-2C79-4DE5-A0AD-0513647B9737}.Debug|x64.ActiveCfg = Debug|x64 + {99A1985B-2C79-4DE5-A0AD-0513647B9737}.Debug|x64.Build.0 = Debug|x64 + {99A1985B-2C79-4DE5-A0AD-0513647B9737}.Debug|x86.ActiveCfg = Debug|x86 + {99A1985B-2C79-4DE5-A0AD-0513647B9737}.Debug|x86.Build.0 = Debug|x86 + {99A1985B-2C79-4DE5-A0AD-0513647B9737}.Release|x64.ActiveCfg = Release|x64 + {99A1985B-2C79-4DE5-A0AD-0513647B9737}.Release|x64.Build.0 = Release|x64 + {99A1985B-2C79-4DE5-A0AD-0513647B9737}.Release|x86.ActiveCfg = Release|x86 + {99A1985B-2C79-4DE5-A0AD-0513647B9737}.Release|x86.Build.0 = Release|x86 + {6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Debug|x64.ActiveCfg = Debug|x64 + {6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Debug|x64.Build.0 = Debug|x64 + {6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Debug|x86.ActiveCfg = Debug|x86 + {6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Debug|x86.Build.0 = Debug|x86 + {6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Release|x64.ActiveCfg = Release|x64 + {6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Release|x64.Build.0 = Release|x64 + {6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Release|x86.ActiveCfg = Release|x86 + {6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {97E41A52-091D-4375-A0F7-696C2F3F3684} + EndGlobalSection +EndGlobal From 52c05f518b4b3420177832c60f4dd1b8eb7731d2 Mon Sep 17 00:00:00 2001 From: kpreisser Date: Sun, 12 Jul 2020 11:43:27 +0200 Subject: [PATCH 2/8] - Remove dependencies to "opengl32.lib" and "glu32.lib" which aren't available for ARM64 and don't seem to be needed. - Clean up project files. --- .../CefSharp.BrowserSubprocess.Core.netcore.vcxproj | 2 +- CefSharp.Core/CefSharp.Core.netcore.vcxproj | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj index b0d4154c08..fc257bc237 100644 --- a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj +++ b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj @@ -1,5 +1,5 @@  - + diff --git a/CefSharp.Core/CefSharp.Core.netcore.vcxproj b/CefSharp.Core/CefSharp.Core.netcore.vcxproj index 33442873ec..731d7ae8db 100644 --- a/CefSharp.Core/CefSharp.Core.netcore.vcxproj +++ b/CefSharp.Core/CefSharp.Core.netcore.vcxproj @@ -1,5 +1,5 @@ - + @@ -68,9 +68,6 @@ - - <_ProjectFileVersion>11.0.51106.1 - bin\$(Platform)\$(Configuration)\ obj\$(Platform)\$(Configuration)\ @@ -135,7 +132,7 @@ false - opengl32.lib;glu32.lib;libcef.lib;libcef_dll_wrapper.lib;%(AdditionalDependencies) + libcef.lib;libcef_dll_wrapper.lib;%(AdditionalDependencies) $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion) false true @@ -165,7 +162,7 @@ false - opengl32.lib;glu32.lib;libcef.lib;libcef_dll_wrapper.lib;%(AdditionalDependencies) + libcef.lib;libcef_dll_wrapper.lib;%(AdditionalDependencies) $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion) false true @@ -188,7 +185,7 @@ true - opengl32.lib;glu32.lib;libcef.lib;libcef_dll_wrapper.lib;%(AdditionalDependencies) + libcef.lib;libcef_dll_wrapper.lib;%(AdditionalDependencies) LinkVerbose $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion) true @@ -208,7 +205,7 @@ true - opengl32.lib;glu32.lib;libcef.lib;libcef_dll_wrapper.lib;%(AdditionalDependencies) + libcef.lib;libcef_dll_wrapper.lib;%(AdditionalDependencies) $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion) true $(LinkKeyFile) From 0f38bf8243df7a68953afff7f3ec37f7173b99a2 Mon Sep 17 00:00:00 2001 From: kpreisser Date: Sun, 12 Jul 2020 13:33:00 +0200 Subject: [PATCH 3/8] Switch project CefSharp.netcore.csproj to AnyCPU as it doesn't require different builds for each platform. --- CefSharp/CefSharp.netcore.csproj | 1 - CefSharp3.netcore.sln | 16 ++++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CefSharp/CefSharp.netcore.csproj b/CefSharp/CefSharp.netcore.csproj index 48fb1e1593..c76df49fd0 100644 --- a/CefSharp/CefSharp.netcore.csproj +++ b/CefSharp/CefSharp.netcore.csproj @@ -8,6 +8,5 @@ true ..\CefSharp.snk MinimumRecommendedRules.ruleset - x86;x64 diff --git a/CefSharp3.netcore.sln b/CefSharp3.netcore.sln index 9b09e491d2..61d9d8946e 100644 --- a/CefSharp3.netcore.sln +++ b/CefSharp3.netcore.sln @@ -49,14 +49,14 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Debug|x64.ActiveCfg = Debug|x64 - {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Debug|x64.Build.0 = Debug|x64 - {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Debug|x86.ActiveCfg = Debug|x86 - {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Debug|x86.Build.0 = Debug|x86 - {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Release|x64.ActiveCfg = Release|x64 - {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Release|x64.Build.0 = Release|x64 - {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Release|x86.ActiveCfg = Release|x86 - {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Release|x86.Build.0 = Release|x86 + {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Debug|x64.ActiveCfg = Debug|Any CPU + {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Debug|x64.Build.0 = Debug|Any CPU + {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Debug|x86.ActiveCfg = Debug|Any CPU + {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Debug|x86.Build.0 = Debug|Any CPU + {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Release|x64.ActiveCfg = Release|Any CPU + {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Release|x64.Build.0 = Release|Any CPU + {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Release|x86.ActiveCfg = Release|Any CPU + {39E385AD-DC5C-451E-B061-09AF3EE038EB}.Release|x86.Build.0 = Release|Any CPU {7B495581-2271-4F41-9476-ACB86E8C864F}.Debug|x64.ActiveCfg = Debug|x64 {7B495581-2271-4F41-9476-ACB86E8C864F}.Debug|x64.Build.0 = Debug|x64 {7B495581-2271-4F41-9476-ACB86E8C864F}.Debug|x86.ActiveCfg = Debug|Win32 From ed2bc512483908b7b520f846d58a9e2e660a4d5a Mon Sep 17 00:00:00 2001 From: kpreisser Date: Sun, 12 Jul 2020 13:40:59 +0200 Subject: [PATCH 4/8] Remove WindowsTargetPlatformVersion property as that is declared in CefSharp.props. --- .../CefSharp.BrowserSubprocess.Core.netcore.vcxproj | 1 - CefSharp.Core/CefSharp.Core.netcore.vcxproj | 1 - 2 files changed, 2 deletions(-) diff --git a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj index fc257bc237..5f65dad143 100644 --- a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj +++ b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj @@ -25,7 +25,6 @@ CefSharp.BrowserSubprocess.Core CefSharpBrowserSubprocessCore NetCoreCProj - 10.0 netcoreapp3.1 diff --git a/CefSharp.Core/CefSharp.Core.netcore.vcxproj b/CefSharp.Core/CefSharp.Core.netcore.vcxproj index 731d7ae8db..1e434643dd 100644 --- a/CefSharp.Core/CefSharp.Core.netcore.vcxproj +++ b/CefSharp.Core/CefSharp.Core.netcore.vcxproj @@ -25,7 +25,6 @@ CefSharp.Core CefSharp NetCoreCProj - 10.0 netcoreapp3.1 From ec4e745ff56c8c7a07c7aae5ee058772c4c60fe6 Mon Sep 17 00:00:00 2001 From: kpreisser Date: Sun, 12 Jul 2020 17:29:30 +0200 Subject: [PATCH 5/8] Use "bin.netcore" and "obj.netcore" as [intermediate] output path for the .NET Core projects, to allow side-by-side builds with the .NET Framework projects. --- .gitignore | 2 ++ ...arp.BrowserSubprocess.Core.netcore.vcxproj | 16 +++++++------- CefSharp.Core/CefSharp.Core.netcore.vcxproj | 16 +++++++------- .../CefSharp.OffScreen.netcore.csproj | 22 +++++++++++++++++-- .../CefSharp.WinForms.netcore.csproj | 20 ++++++++++++++++- CefSharp.Wpf/CefSharp.Wpf.netcore.csproj | 22 +++++++++++++++++-- CefSharp/CefSharp.netcore.csproj | 20 ++++++++++++++++- 7 files changed, 96 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index 2dd9e157d8..ebc7fe0304 100644 --- a/.gitignore +++ b/.gitignore @@ -21,7 +21,9 @@ _ReSharper* bin/ +bin.netcore/ obj/ +obj.netcore/ packages/ Debug/ Release/ diff --git a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj index 5f65dad143..52d820d947 100644 --- a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj +++ b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj @@ -73,30 +73,30 @@ true ..\CefSharp.snk true - bin\$(Platform)\$(Configuration)\ - obj\$(Platform)\$(Configuration)\ + bin.netcore\$(Platform)\$(Configuration)\ + obj.netcore\$(Platform)\$(Configuration)\ $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) true ..\CefSharp.snk true - bin\$(Platform)\$(Configuration)\ - obj\$(Platform)\$(Configuration)\ + bin.netcore\$(Platform)\$(Configuration)\ + obj.netcore\$(Platform)\$(Configuration)\ $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) false ..\CefSharp.snk - bin\$(Platform)\$(Configuration)\ - obj\$(Platform)\$(Configuration)\ + bin.netcore\$(Platform)\$(Configuration)\ + obj.netcore\$(Platform)\$(Configuration)\ $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) false ..\CefSharp.snk - bin\$(Platform)\$(Configuration)\ - obj\$(Platform)\$(Configuration)\ + bin.netcore\$(Platform)\$(Configuration)\ + obj.netcore\$(Platform)\$(Configuration)\ $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) diff --git a/CefSharp.Core/CefSharp.Core.netcore.vcxproj b/CefSharp.Core/CefSharp.Core.netcore.vcxproj index 1e434643dd..b55e04d6e7 100644 --- a/CefSharp.Core/CefSharp.Core.netcore.vcxproj +++ b/CefSharp.Core/CefSharp.Core.netcore.vcxproj @@ -68,8 +68,8 @@ - bin\$(Platform)\$(Configuration)\ - obj\$(Platform)\$(Configuration)\ + bin.netcore\$(Platform)\$(Configuration)\ + obj.netcore\$(Platform)\$(Configuration)\ false false ..\CefSharp.snk @@ -87,19 +87,19 @@ CefSharp.Core - bin\$(Platform)\$(Configuration)\ - obj\$(Platform)\$(Configuration)\ + bin.netcore\$(Platform)\$(Configuration)\ + obj.netcore\$(Platform)\$(Configuration)\ $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) - bin\$(Platform)\$(Configuration)\ + bin.netcore\$(Platform)\$(Configuration)\ false AllRules.ruleset CefSharp.Core ..\CefSharp.snk - obj\$(Platform)\$(Configuration)\ + obj.netcore\$(Platform)\$(Configuration)\ $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) @@ -109,8 +109,8 @@ CefSharp.Core ..\CefSharp.snk - bin\$(Platform)\$(Configuration)\ - obj\$(Platform)\$(Configuration)\ + bin.netcore\$(Platform)\$(Configuration)\ + obj.netcore\$(Platform)\$(Configuration)\ $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) diff --git a/CefSharp.OffScreen/CefSharp.OffScreen.netcore.csproj b/CefSharp.OffScreen/CefSharp.OffScreen.netcore.csproj index 4f716e7eef..f84e627d41 100644 --- a/CefSharp.OffScreen/CefSharp.OffScreen.netcore.csproj +++ b/CefSharp.OffScreen/CefSharp.OffScreen.netcore.csproj @@ -1,5 +1,14 @@ - - + + + + + obj.netcore\ + bin.netcore\ + + + + netcoreapp3.1 CefSharp.OffScreen @@ -16,4 +25,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/CefSharp.WinForms/CefSharp.WinForms.netcore.csproj b/CefSharp.WinForms/CefSharp.WinForms.netcore.csproj index f0bc9f1487..40f46f431d 100644 --- a/CefSharp.WinForms/CefSharp.WinForms.netcore.csproj +++ b/CefSharp.WinForms/CefSharp.WinForms.netcore.csproj @@ -1,5 +1,14 @@ - + + + + obj.netcore\ + bin.netcore\ + + + + netcoreapp3.1 CefSharp.WinForms @@ -24,4 +33,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/CefSharp.Wpf/CefSharp.Wpf.netcore.csproj b/CefSharp.Wpf/CefSharp.Wpf.netcore.csproj index 738e6b81da..115c3ac270 100644 --- a/CefSharp.Wpf/CefSharp.Wpf.netcore.csproj +++ b/CefSharp.Wpf/CefSharp.Wpf.netcore.csproj @@ -1,5 +1,14 @@ - - + + + + + obj.netcore\ + bin.netcore\ + + + + netcoreapp3.1 CefSharp.Wpf @@ -16,4 +25,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/CefSharp/CefSharp.netcore.csproj b/CefSharp/CefSharp.netcore.csproj index c76df49fd0..bb25bd6087 100644 --- a/CefSharp/CefSharp.netcore.csproj +++ b/CefSharp/CefSharp.netcore.csproj @@ -1,5 +1,14 @@ - + + + + obj.netcore\ + bin.netcore\ + + + + netcoreapp3.1 CefSharp @@ -9,4 +18,13 @@ ..\CefSharp.snk MinimumRecommendedRules.ruleset + + + + + + + + + From db171aba59db0f2865b5e0622c84271b7e01d918 Mon Sep 17 00:00:00 2001 From: kpreisser Date: Sun, 12 Jul 2020 17:45:25 +0200 Subject: [PATCH 6/8] Output documentation files. --- CefSharp.OffScreen/CefSharp.OffScreen.netcore.csproj | 1 + CefSharp.WinForms/CefSharp.WinForms.netcore.csproj | 1 + CefSharp.Wpf/CefSharp.Wpf.netcore.csproj | 1 + CefSharp/CefSharp.netcore.csproj | 1 + 4 files changed, 4 insertions(+) diff --git a/CefSharp.OffScreen/CefSharp.OffScreen.netcore.csproj b/CefSharp.OffScreen/CefSharp.OffScreen.netcore.csproj index f84e627d41..0a06c224bf 100644 --- a/CefSharp.OffScreen/CefSharp.OffScreen.netcore.csproj +++ b/CefSharp.OffScreen/CefSharp.OffScreen.netcore.csproj @@ -13,6 +13,7 @@ netcoreapp3.1 CefSharp.OffScreen CefSharp.OffScreen + $(BaseOutputPath)$(PlatformTarget)\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml true false true diff --git a/CefSharp.WinForms/CefSharp.WinForms.netcore.csproj b/CefSharp.WinForms/CefSharp.WinForms.netcore.csproj index 40f46f431d..a816a723ba 100644 --- a/CefSharp.WinForms/CefSharp.WinForms.netcore.csproj +++ b/CefSharp.WinForms/CefSharp.WinForms.netcore.csproj @@ -13,6 +13,7 @@ netcoreapp3.1 CefSharp.WinForms CefSharp.WinForms + $(BaseOutputPath)$(PlatformTarget)\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml true false true diff --git a/CefSharp.Wpf/CefSharp.Wpf.netcore.csproj b/CefSharp.Wpf/CefSharp.Wpf.netcore.csproj index 115c3ac270..89422325b1 100644 --- a/CefSharp.Wpf/CefSharp.Wpf.netcore.csproj +++ b/CefSharp.Wpf/CefSharp.Wpf.netcore.csproj @@ -13,6 +13,7 @@ netcoreapp3.1 CefSharp.Wpf CefSharp.Wpf + $(BaseOutputPath)$(PlatformTarget)\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml true false true diff --git a/CefSharp/CefSharp.netcore.csproj b/CefSharp/CefSharp.netcore.csproj index bb25bd6087..9ba8ffae66 100644 --- a/CefSharp/CefSharp.netcore.csproj +++ b/CefSharp/CefSharp.netcore.csproj @@ -13,6 +13,7 @@ netcoreapp3.1 CefSharp CefSharp + $(BaseOutputPath)$(Configuration)\$(TargetFramework)\$(AssemblyName).xml false true ..\CefSharp.snk From 558a66a836b20e9c96b8b7c62cc8a257c94f1910 Mon Sep 17 00:00:00 2001 From: kpreisser Date: Thu, 16 Jul 2020 20:01:55 +0200 Subject: [PATCH 7/8] Add CefSharp.Example.netcore and CefSharp.WinForms.Example.netcore. --- CefSharp.Example/CefExample.cs | 27 ++++- .../CefSharp.Example.netcore.csproj | 112 ++++++++++++++++++ .../Handlers/BrowserProcessHandler.cs | 8 +- CefSharp.WinForms.Example/BrowserForm.cs | 9 +- .../BrowserTabUserControl.cs | 4 + .../CefSharp.WinForms.Example.netcore.csproj | 56 +++++++++ .../Minimal/SimpleBrowserForm.cs | 3 + CefSharp.WinForms.Example/Program.cs | 12 ++ CefSharp3.netcore.sln | 20 ++++ 9 files changed, 247 insertions(+), 4 deletions(-) create mode 100644 CefSharp.Example/CefSharp.Example.netcore.csproj create mode 100644 CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj diff --git a/CefSharp.Example/CefExample.cs b/CefSharp.Example/CefExample.cs index d070c42d53..f2864f7427 100644 --- a/CefSharp.Example/CefExample.cs +++ b/CefSharp.Example/CefExample.cs @@ -159,11 +159,18 @@ public static void Init(CefSettingsBase settings, IBrowserProcessHandler browser //settings.LogSeverity = LogSeverity.Verbose; +#if !NETCOREAPP if (DebuggingSubProcess) { var architecture = Environment.Is64BitProcess ? "x64" : "x86"; settings.BrowserSubprocessPath = Path.GetFullPath("..\\..\\..\\..\\CefSharp.BrowserSubprocess\\bin\\" + architecture + "\\Debug\\CefSharp.BrowserSubprocess.exe"); } +#else + // We use our Applications exe as the BrowserSubProcess, multiple copies + // will be spawned. + var exePath = Process.GetCurrentProcess().MainModule.FileName; + settings.BrowserSubprocessPath = exePath; +#endif settings.RegisterScheme(new CefCustomScheme { @@ -195,10 +202,17 @@ public static void Init(CefSettingsBase settings, IBrowserProcessHandler browser IsSecure = true //treated with the same security rules as those applied to "https" URLs }); + const string cefSharpExampleResourcesFolder = +#if !NETCOREAPP + @"..\..\..\..\CefSharp.Example\Resources"; +#else + @"..\..\..\..\..\CefSharp.Example\Resources"; +#endif + settings.RegisterScheme(new CefCustomScheme { SchemeName = "localfolder", - SchemeHandlerFactory = new FolderSchemeHandlerFactory(rootFolder: @"..\..\..\..\CefSharp.Example\Resources", + SchemeHandlerFactory = new FolderSchemeHandlerFactory(rootFolder: cefSharpExampleResourcesFolder, schemeName: "localfolder", //Optional param no schemename checking if null hostName: "cefsharp", //Optional param no hostname checking if null defaultPage: "home.html") //Optional param will default to index.html @@ -227,7 +241,16 @@ public static void Init(CefSettingsBase settings, IBrowserProcessHandler browser //see https://github.com/cefsharp/CefSharp/wiki/General-Usage#proxy-resolution //CefSharpSettings.Proxy = new ProxyOptions(ip: "127.0.0.1", port: "8080", username: "cefsharp", password: "123"); - if (!Cef.Initialize(settings, performDependencyCheck: !DebuggingSubProcess, browserProcessHandler: browserProcessHandler)) + bool performDependencyCheck = +#if !NETCOREAPP + !DebuggingSubProcess; +#else + // For .NET Core, don't perform a dependency check, to allow publishing single-file + // executables. + false; +#endif + + if (!Cef.Initialize(settings, performDependencyCheck: performDependencyCheck, browserProcessHandler: browserProcessHandler)) { throw new Exception("Unable to Initialize Cef"); } diff --git a/CefSharp.Example/CefSharp.Example.netcore.csproj b/CefSharp.Example/CefSharp.Example.netcore.csproj new file mode 100644 index 0000000000..6b61290936 --- /dev/null +++ b/CefSharp.Example/CefSharp.Example.netcore.csproj @@ -0,0 +1,112 @@ + + + + + obj.netcore\ + bin.netcore\ + + + + + + netcoreapp3.1 + CefSharp.Example + CefSharp.Example + $(BaseOutputPath)$(PlatformTarget)\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml + true + false + true + ..\CefSharp.snk + AllRules.ruleset + x86;x64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PublicResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + True + Resources.resx + + + + + + + $(CefSharpTargetDir)\%(RecursiveDir)%(FileName)%(Extension) + PreserveNewest + false + Included + + + + + $(CefSharpTargetDir)\%(RecursiveDir)%(FileName)%(Extension) + PreserveNewest + false + Included + + + + + + + + + + + + \ No newline at end of file diff --git a/CefSharp.Example/Handlers/BrowserProcessHandler.cs b/CefSharp.Example/Handlers/BrowserProcessHandler.cs index f483cd6784..eb96ce04fc 100644 --- a/CefSharp.Example/Handlers/BrowserProcessHandler.cs +++ b/CefSharp.Example/Handlers/BrowserProcessHandler.cs @@ -93,7 +93,13 @@ void IBrowserProcessHandler.OnContextInitialized() //In this example we register the FolderSchemeHandlerFactory for https://cefsharp.example //Best to include the domain name, so only requests for that domain are forwarded to your scheme handler //It is possible to intercept all requests for a scheme, including the built in http/https ones, be very careful doing this! - var folderSchemeHandlerExample = new FolderSchemeHandlerFactory(rootFolder: @"..\..\..\..\CefSharp.Example\Resources", + const string cefSharpExampleResourcesFolder = +#if !NETCOREAPP + @"..\..\..\..\CefSharp.Example\Resources"; +#else + @"..\..\..\..\..\CefSharp.Example\Resources"; +#endif + var folderSchemeHandlerExample = new FolderSchemeHandlerFactory(rootFolder: cefSharpExampleResourcesFolder, hostName: "cefsharp.example", //Optional param no hostname checking if null defaultPage: "home.html"); //Optional param will default to index.html diff --git a/CefSharp.WinForms.Example/BrowserForm.cs b/CefSharp.WinForms.Example/BrowserForm.cs index af532cde5c..376129a5dd 100644 --- a/CefSharp.WinForms.Example/BrowserForm.cs +++ b/CefSharp.WinForms.Example/BrowserForm.cs @@ -566,7 +566,14 @@ private void LoadExtensionsToolStripMenuItemClick(object sender, EventArgs e) { var requestContext = control.Browser.GetBrowserHost().RequestContext; - var dir = Path.Combine(AppContext.BaseDirectory, @"..\..\..\..\CefSharp.Example\Extensions"); + const string cefSharpExampleResourcesFolder = +#if !NETCOREAPP + @"..\..\..\..\CefSharp.Example\Extensions"; +#else + @"..\..\..\..\..\CefSharp.Example\Resources"; +#endif + + var dir = Path.Combine(AppContext.BaseDirectory, cefSharpExampleResourcesFolder); dir = Path.GetFullPath(dir); if (!Directory.Exists(dir)) { diff --git a/CefSharp.WinForms.Example/BrowserTabUserControl.cs b/CefSharp.WinForms.Example/BrowserTabUserControl.cs index 91bf07b931..abe4e94aea 100644 --- a/CefSharp.WinForms.Example/BrowserTabUserControl.cs +++ b/CefSharp.WinForms.Example/BrowserTabUserControl.cs @@ -65,7 +65,9 @@ public BrowserTabUserControl(Action openNewTab, string url, bool m browser.IsBrowserInitializedChanged += OnIsBrowserInitializedChanged; browser.LoadError += OnLoadError; +#if !NETCOREAPP browser.JavascriptObjectRepository.Register("bound", new BoundObject(), isAsync: false, options: BindingOptions.DefaultBinder); +#endif browser.JavascriptObjectRepository.Register("boundAsync", new AsyncBoundObject(), isAsync: true, options: BindingOptions.DefaultBinder); //If you call CefSharp.BindObjectAsync in javascript and pass in the name of an object which is not yet @@ -90,7 +92,9 @@ public BrowserTabUserControl(Action openNewTab, string url, bool m eventObject.EventArrived += OnJavascriptEventArrived; // Use the default of camelCaseJavascriptNames // .Net methods starting with a capitol will be translated to starting with a lower case letter when called from js +#if !NETCOREAPP browser.JavascriptObjectRepository.Register("boundEvent", eventObject, isAsync: false, options: BindingOptions.DefaultBinder); +#endif CefExample.RegisterTestResources(browser); diff --git a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj new file mode 100644 index 0000000000..10e1c27530 --- /dev/null +++ b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj @@ -0,0 +1,56 @@ + + + + + obj.netcore\ + bin.netcore\ + + + + + + WinExe + netcoreapp3.1 + CefSharp.WinForms.Example + CefSharp.WinForms.Example + $(BaseOutputPath)$(PlatformTarget)\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml + true + false + app.manifest + true + ..\CefSharp.snk + MinimumRecommendedRules.ruleset + x86;x64 + + + + + + + + + + + + + True + True + Resources.resx + + + + + PreserveNewest + + + + + + + + + + + + \ No newline at end of file diff --git a/CefSharp.WinForms.Example/Minimal/SimpleBrowserForm.cs b/CefSharp.WinForms.Example/Minimal/SimpleBrowserForm.cs index 521bc40336..3b8bf02107 100644 --- a/CefSharp.WinForms.Example/Minimal/SimpleBrowserForm.cs +++ b/CefSharp.WinForms.Example/Minimal/SimpleBrowserForm.cs @@ -67,7 +67,10 @@ private void CreateBrowser() browser.StatusMessage += OnBrowserStatusMessage; browser.TitleChanged += OnBrowserTitleChanged; browser.AddressChanged += OnBrowserAddressChanged; +#if !NETCOREAPP browser.JavascriptObjectRepository.Register("bound", new BoundObject(), false); +#endif + if (!multiThreadedMessageLoop) { browser.FocusHandler = null; diff --git a/CefSharp.WinForms.Example/Program.cs b/CefSharp.WinForms.Example/Program.cs index 209cd82b06..284d30b15f 100644 --- a/CefSharp.WinForms.Example/Program.cs +++ b/CefSharp.WinForms.Example/Program.cs @@ -50,6 +50,18 @@ public static int Main(string[] args) } else { +#if NETCOREAPP + //We are using our current exe as the BrowserSubProcess + //Multiple instances will be spawned to handle all the + //Chromium proceses, render, gpu, network, plugin, etc. + var subProcessExe = new CefSharp.BrowserSubprocess.BrowserSubprocessExecutable(); + var result = subProcessExe.Main(args); + if (result > 0) + { + return result; + } +#endif + #if DEBUG if (!System.Diagnostics.Debugger.IsAttached) { diff --git a/CefSharp3.netcore.sln b/CefSharp3.netcore.sln index 61d9d8946e..9d53ff7e4a 100644 --- a/CefSharp3.netcore.sln +++ b/CefSharp3.netcore.sln @@ -41,6 +41,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{A23AA466 NuGet\Readme.txt = NuGet\Readme.txt EndProjectSection EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CefSharp.Example.netcore", "CefSharp.Example\CefSharp.Example.netcore.csproj", "{89540209-0C6D-4387-BE8A-7593B8D7784A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CefSharp.WinForms.Example.netcore", "CefSharp.WinForms.Example\CefSharp.WinForms.Example.netcore.csproj", "{64E47346-0BB1-4DF7-B135-12D70E1F2F32}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -97,6 +101,22 @@ Global {6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Release|x64.Build.0 = Release|x64 {6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Release|x86.ActiveCfg = Release|x86 {6680485E-7A5A-4661-86EB-F7B7B6AE4ADE}.Release|x86.Build.0 = Release|x86 + {89540209-0C6D-4387-BE8A-7593B8D7784A}.Debug|x64.ActiveCfg = Debug|x64 + {89540209-0C6D-4387-BE8A-7593B8D7784A}.Debug|x64.Build.0 = Debug|x64 + {89540209-0C6D-4387-BE8A-7593B8D7784A}.Debug|x86.ActiveCfg = Debug|x86 + {89540209-0C6D-4387-BE8A-7593B8D7784A}.Debug|x86.Build.0 = Debug|x86 + {89540209-0C6D-4387-BE8A-7593B8D7784A}.Release|x64.ActiveCfg = Release|x64 + {89540209-0C6D-4387-BE8A-7593B8D7784A}.Release|x64.Build.0 = Release|x64 + {89540209-0C6D-4387-BE8A-7593B8D7784A}.Release|x86.ActiveCfg = Release|x86 + {89540209-0C6D-4387-BE8A-7593B8D7784A}.Release|x86.Build.0 = Release|x86 + {64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Debug|x64.ActiveCfg = Debug|x64 + {64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Debug|x64.Build.0 = Debug|x64 + {64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Debug|x86.ActiveCfg = Debug|x86 + {64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Debug|x86.Build.0 = Debug|x86 + {64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Release|x64.ActiveCfg = Release|x64 + {64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Release|x64.Build.0 = Release|x64 + {64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Release|x86.ActiveCfg = Release|x86 + {64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 716e6140588bc51b682a67ca90f8d8ea319a5434 Mon Sep 17 00:00:00 2001 From: kpreisser Date: Thu, 16 Jul 2020 20:18:17 +0200 Subject: [PATCH 8/8] Follow-up: Remove properties from the example projects that are also not used in the corresponding .NET Framework projects. --- CefSharp.Example/CefSharp.Example.netcore.csproj | 3 --- .../CefSharp.WinForms.Example.netcore.csproj | 3 --- 2 files changed, 6 deletions(-) diff --git a/CefSharp.Example/CefSharp.Example.netcore.csproj b/CefSharp.Example/CefSharp.Example.netcore.csproj index 6b61290936..f93b5d8ea2 100644 --- a/CefSharp.Example/CefSharp.Example.netcore.csproj +++ b/CefSharp.Example/CefSharp.Example.netcore.csproj @@ -13,11 +13,8 @@ netcoreapp3.1 CefSharp.Example CefSharp.Example - $(BaseOutputPath)$(PlatformTarget)\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml true false - true - ..\CefSharp.snk AllRules.ruleset x86;x64 diff --git a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj index 10e1c27530..660c377db2 100644 --- a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj +++ b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj @@ -14,12 +14,9 @@ netcoreapp3.1 CefSharp.WinForms.Example CefSharp.WinForms.Example - $(BaseOutputPath)$(PlatformTarget)\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml true false app.manifest - true - ..\CefSharp.snk MinimumRecommendedRules.ruleset x86;x64