From 6653188d2ba6e469a7529874a3a9cec694d022b9 Mon Sep 17 00:00:00 2001 From: kpreisser Date: Thu, 21 Jan 2021 19:21:52 +0100 Subject: [PATCH 1/6] Add support for Windows ARM64 for the NETCore packages. Note: .NET 5.0 or higher is required to build a WinForms/WPF application for win-arm64. Fixes cefsharp/CefSharp#2944 --- ...arp.BrowserSubprocess.Core.netcore.vcxproj | 79 ++++++++++++++ .../CefSharp.BrowserSubprocess.netcore.csproj | 6 +- ...rp.Core.Runtime.RefAssembly.netcore.csproj | 7 +- .../CefSharp.Core.Runtime.netcore.vcxproj | 101 ++++++++++++++++++ CefSharp.Core/Initializer.cs | 3 +- .../CefSharp.OffScreen.Example.netcore.csproj | 7 +- CefSharp.Test/CefSharp.Test.netcore.csproj | 7 +- .../CefSharp.WinForms.Example.netcore.csproj | 7 +- .../CefSharp.Wpf.Example.netcore.csproj | 7 +- CefSharp3.netcore.sln | 58 ++++++++++ .../CefSharp.Common.NETCore.nuspec | 15 +++ .../CefSharp.Common.NETCore.targets | 56 +++++++++- build.netcore.ps1 | 3 +- 13 files changed, 338 insertions(+), 18 deletions(-) diff --git a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj index 6695c5315f..a60266d302 100644 --- a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj +++ b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj @@ -10,6 +10,10 @@ Debug x64 + + Debug + arm64 + Release Win32 @@ -18,6 +22,10 @@ Release x64 + + Release + arm64 + 16.0 @@ -41,6 +49,12 @@ NetCore Unicode + + DynamicLibrary + true + NetCore + Unicode + DynamicLibrary false @@ -53,6 +67,12 @@ NetCore Unicode + + DynamicLibrary + false + NetCore + Unicode + @@ -62,12 +82,18 @@ + + + + + + true @@ -85,6 +111,14 @@ obj.netcore\$(Platform)\$(Configuration)\ $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + true + ..\CefSharp.snk + true + bin.netcore\$(Platform)\$(Configuration)\ + obj.netcore\$(Platform)\$(Configuration)\ + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + false ..\CefSharp.snk @@ -99,6 +133,13 @@ obj.netcore\$(Platform)\$(Configuration)\ $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + false + ..\CefSharp.snk + bin.netcore\$(Platform)\$(Configuration)\ + obj.netcore\$(Platform)\$(Configuration)\ + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + Level3 @@ -138,6 +179,25 @@ Assembly.manifest + + + 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) + + + Assembly.manifest + + Level3 @@ -173,6 +233,23 @@ Assembly.manifest + + + 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) + + + Assembly.manifest + + @@ -223,8 +300,10 @@ Create Create + Create Create Create + Create diff --git a/CefSharp.BrowserSubprocess/CefSharp.BrowserSubprocess.netcore.csproj b/CefSharp.BrowserSubprocess/CefSharp.BrowserSubprocess.netcore.csproj index b66c10421c..45544315f8 100644 --- a/CefSharp.BrowserSubprocess/CefSharp.BrowserSubprocess.netcore.csproj +++ b/CefSharp.BrowserSubprocess/CefSharp.BrowserSubprocess.netcore.csproj @@ -12,7 +12,7 @@ WinExe - netcoreapp3.1 + netcoreapp3.1;net5.0 CefSharp.BrowserSubprocess CefSharp.BrowserSubprocess false @@ -21,7 +21,9 @@ MinimumRecommendedRules.ruleset app.manifest CefSharp.BrowserSubprocess.Program - x86;x64 + x86;x64;arm64 + + arm64 @@ -59,6 +59,11 @@ $(SolutionDir)CefSharp.Core.Runtime\bin.netcore\x64\$(Configuration)\CefSharp.Core.Runtime.dll + + + $(SolutionDir)CefSharp.Core.Runtime\bin.netcore\arm64\$(Configuration)\CefSharp.Core.Runtime.dll + + $(SolutionDir)CefSharp.Core.Runtime\bin.netcore\win32\$(Configuration)\CefSharp.Core.Runtime.dll diff --git a/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj index 72a1682d82..cc3856bdb0 100644 --- a/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj +++ b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj @@ -10,6 +10,10 @@ Debug x64 + + Debug + arm64 + Release Win32 @@ -18,6 +22,10 @@ Release x64 + + Release + arm64 + 16.0 @@ -41,6 +49,12 @@ NetCore true + + DynamicLibrary + Unicode + NetCore + true + DynamicLibrary Unicode @@ -51,6 +65,11 @@ Unicode NetCore + + DynamicLibrary + Unicode + NetCore + @@ -60,12 +79,18 @@ + + + + + + bin.netcore\$(Platform)\$(Configuration)\ @@ -91,6 +116,18 @@ obj.netcore\$(Platform)\$(Configuration)\ $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + false + false + ..\CefSharp.snk + AllRules.ruleset + + + CefSharp.Core.Runtime + bin.netcore\$(Platform)\$(Configuration)\ + obj.netcore\$(Platform)\$(Configuration)\ + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + bin.netcore\$(Platform)\$(Configuration)\ false @@ -113,6 +150,17 @@ obj.netcore\$(Platform)\$(Configuration)\ $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + + false + AllRules.ruleset + + + CefSharp.Core.Runtime + ..\CefSharp.snk + bin.netcore\$(Platform)\$(Configuration)\ + obj.netcore\$(Platform)\$(Configuration)\ + $(SolutionDir)packages\$(CefSdkVer)\CEF;$(SourcePath) + Disabled @@ -177,6 +225,36 @@ Assembly.manifest + + + 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 + + + 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) + + + Assembly.manifest + + $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) @@ -222,6 +300,27 @@ Assembly.manifest + + + $(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 + + + libcef.lib;libcef_dll_wrapper.lib;%(AdditionalDependencies) + $(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration);$(SolutionDir)packages\$(CefSdkVer)\CEF\$(Platform)\$(Configuration)\VS$(VisualStudioProductVersion) + true + $(LinkKeyFile) + + + Assembly.manifest + + @@ -248,8 +347,10 @@ Create Create + Create Create Create + Create diff --git a/CefSharp.Core/Initializer.cs b/CefSharp.Core/Initializer.cs index d210853328..9cf843e166 100644 --- a/CefSharp.Core/Initializer.cs +++ b/CefSharp.Core/Initializer.cs @@ -39,8 +39,7 @@ internal static void ModuleInitializer() } else { - //TODO: This will need changing if we support ARM64 - var arch = Environment.Is64BitProcess ? "x64" : "x86"; + var arch = RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); var archFolder = $"runtimes\\win-{arch}\\native"; libCefPath = Path.Combine(currentFolder, archFolder, "libcef.dll"); if (File.Exists(libCefPath)) diff --git a/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj b/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj index 510d687124..b2b273c9dc 100644 --- a/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj +++ b/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj @@ -1,4 +1,4 @@ - + @@ -17,7 +17,9 @@ false app.manifest MinimumRecommendedRules.ruleset - x86;x64 + x86;x64;arm64 + + arm64 CefSharp.OffScreen.Example.Program @@ -17,7 +17,9 @@ true false MinimumRecommendedRules.ruleset - x86;x64 + x86;x64;arm64 + + arm64 @@ -29,6 +31,7 @@ + diff --git a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj index b428a9b32f..c5d582ba0f 100644 --- a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj +++ b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj @@ -1,4 +1,4 @@ - + @@ -18,7 +18,9 @@ false app.manifest MinimumRecommendedRules.ruleset - x86;x64 + x86;x64;arm64 + + arm64 @@ -18,7 +18,9 @@ false app.manifest MinimumRecommendedRules.ruleset - x86;x64 + x86;x64;arm64 + + arm64 CefSharp.Wpf.Example.Program + + @@ -46,6 +48,10 @@ + + + + @@ -55,6 +61,10 @@ + + + + @@ -63,5 +73,10 @@ + + + + + \ No newline at end of file diff --git a/NuGet/PackageReference/CefSharp.Common.NETCore.targets b/NuGet/PackageReference/CefSharp.Common.NETCore.targets index 4bcd58b5ba..6e9fcb08bf 100644 --- a/NuGet/PackageReference/CefSharp.Common.NETCore.targets +++ b/NuGet/PackageReference/CefSharp.Common.NETCore.targets @@ -37,10 +37,29 @@ - - - - + + + + locales\%(RecursiveDir)%(FileName)%(Extension) + PreserveNewest + Included + false + true + + + swiftshader\%(RecursiveDir)%(FileName)%(Extension) + PreserveNewest + Included + false + true + + + + + + + + runtimes\win-x86\native\locales\%(RecursiveDir)%(FileName)%(Extension) PreserveNewest @@ -98,6 +117,35 @@ false true + + + runtimes\win-arm64\native\locales\%(RecursiveDir)%(FileName)%(Extension) + PreserveNewest + Included + false + true + + + runtimes\win-arm64\native\swiftshader\%(RecursiveDir)%(FileName)%(Extension) + PreserveNewest + Included + false + true + + + runtimes\win-arm64\native\%(RecursiveDir)%(FileName)%(Extension) + PreserveNewest + Included + false + true + + + runtimes\win-arm64\native\%(RecursiveDir)%(FileName)%(Extension) + PreserveNewest + Included + false + true + diff --git a/build.netcore.ps1 b/build.netcore.ps1 index a521c305df..ccc8e96346 100644 --- a/build.netcore.ps1 +++ b/build.netcore.ps1 @@ -91,7 +91,7 @@ function Msvs [string] $Configuration, [Parameter(Position = 1, ValueFromPipeline = $true)] - [ValidateSet('x86', 'x64')] + [ValidateSet('x86', 'x64', 'arm64')] [string] $Platform ) @@ -178,6 +178,7 @@ function Compile # Compile Msvs 'Release' 'x64' Msvs 'Release' 'x86' + Msvs 'Release' 'arm64' } function Nupkg From 74e9f7851c709196e591d11fc179afb100f78b44 Mon Sep 17 00:00:00 2001 From: kpreisser Date: Thu, 21 Jan 2021 19:34:34 +0100 Subject: [PATCH 2/6] PR feedback: Remove "WIN32" define as it is already defined by minwindef.h. --- .../CefSharp.BrowserSubprocess.Core.netcore.vcxproj | 12 ++++++------ .../CefSharp.Core.Runtime.netcore.vcxproj | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj index a60266d302..dd6ccde79f 100644 --- a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj +++ b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.netcore.vcxproj @@ -145,7 +145,7 @@ Level3 $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) Disabled - WIN32;_DEBUG;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) + _DEBUG;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) Use true true @@ -165,7 +165,7 @@ Level3 $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) Disabled - WIN32;_DEBUG;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) + _DEBUG;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) Use true @@ -184,7 +184,7 @@ Level3 $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) Disabled - WIN32;_DEBUG;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) + _DEBUG;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) Use true @@ -202,7 +202,7 @@ Level3 $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) - WIN32;NDEBUG;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) + NDEBUG;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) Use true true @@ -220,7 +220,7 @@ Level3 $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) - WIN32;NDEBUG;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) + NDEBUG;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) Use true @@ -237,7 +237,7 @@ Level3 $(SolutionDir)packages\$(CefSdkVer)\CEF;%(AdditionalIncludeDirectories);$(ProjectDir) - WIN32;NDEBUG;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) + NDEBUG;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) Use true diff --git a/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj index cc3856bdb0..d23222d06a 100644 --- a/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj +++ b/CefSharp.Core.Runtime/CefSharp.Core.Runtime.netcore.vcxproj @@ -165,7 +165,7 @@ 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) + _DEBUG;_WIN32_WINNT=0x0600;WINVER=0x0600;_WINDOWS;WIN32_LEAN_AND_MEAN;USING_CEF_SHARED;_CRT_SECURE_NO_WARNINGS;EXPORT;OS_WIN;NETCOREAPP;%(PreprocessorDefinitions) MultiThreadedDebugDLL Use true @@ -199,7 +199,7 @@ 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) + _DEBUG;_WIN32_WINNT=0x0600;WINVER=0x0600;_WINDOWS;WIN32_LEAN_AND_MEAN;USING_CEF_SHARED;_CRT_SECURE_NO_WARNINGS;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) MultiThreadedDebugDLL Use true @@ -229,7 +229,7 @@ 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) + _DEBUG;_WIN32_WINNT=0x0600;WINVER=0x0600;_WINDOWS;WIN32_LEAN_AND_MEAN;USING_CEF_SHARED;_CRT_SECURE_NO_WARNINGS;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) MultiThreadedDebugDLL Use true @@ -258,7 +258,7 @@ $(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) + _NDEBUG;_WIN32_WINNT=0x0600;WINVER=0x0600;_WINDOWS;WIN32_LEAN_AND_MEAN;USING_CEF_SHARED;_CRT_SECURE_NO_WARNINGS;EXPORT;OS_WIN;NETCOREAPP;%(PreprocessorDefinitions) MultiThreadedDLL Use Level3 @@ -282,7 +282,7 @@ $(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) + _NDEBUG;_WIN32_WINNT=0x0600;WINVER=0x0600;_WINDOWS;WIN32_LEAN_AND_MEAN;USING_CEF_SHARED;_CRT_SECURE_NO_WARNINGS;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) MultiThreadedDLL Use Level3 @@ -303,7 +303,7 @@ $(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) + _NDEBUG;_WIN32_WINNT=0x0600;WINVER=0x0600;_WINDOWS;WIN32_LEAN_AND_MEAN;USING_CEF_SHARED;_CRT_SECURE_NO_WARNINGS;EXPORT;NETCOREAPP;%(PreprocessorDefinitions) MultiThreadedDLL Use Level3 From 5787ca61ee11ad861141c7bb7d006abb544cbc05 Mon Sep 17 00:00:00 2001 From: kpreisser Date: Thu, 21 Jan 2021 21:01:45 +0100 Subject: [PATCH 3/6] PR feedback: Switch the CefSharp.*.Example.netcore and CefSharp.Test.netcore projects from cef.redist to chromiumembeddedframework.runtime. Note: These projects are excluded for build when platform is 'arm64', as otherwise the build fails as WinForms and WPF are not yet available for ARM64 in .NET 5.0. --- CefSharp.Example/CefExample.cs | 7 ++++--- CefSharp.Example/Handlers/BrowserProcessHandler.cs | 2 +- .../CefSharp.OffScreen.Example.netcore.csproj | 9 ++++++--- CefSharp.Test/CefSharp.Test.netcore.csproj | 11 +++++++---- CefSharp.WinForms.Example/BrowserForm.cs | 4 ++++ .../CefSharp.WinForms.Example.netcore.csproj | 9 ++++++--- .../Minimal/SimpleBrowserForm.cs | 4 ++++ .../CefSharp.Wpf.Example.netcore.csproj | 9 ++++++--- CefSharp.Wpf.Example/MainWindow.xaml.cs | 4 ++++ CefSharp3.netcore.sln | 8 -------- 10 files changed, 42 insertions(+), 25 deletions(-) diff --git a/CefSharp.Example/CefExample.cs b/CefSharp.Example/CefExample.cs index ae827b1fa2..511b854ff0 100644 --- a/CefSharp.Example/CefExample.cs +++ b/CefSharp.Example/CefExample.cs @@ -168,10 +168,11 @@ public static void Init(CefSettingsBase settings, IBrowserProcessHandler browser if (DebuggingSubProcess) { - var architecture = Environment.Is64BitProcess ? "x64" : "x86"; #if NETCOREAPP - settings.BrowserSubprocessPath = Path.GetFullPath("..\\..\\..\\..\\..\\CefSharp.BrowserSubprocess\\bin.netcore\\" + architecture + "\\Debug\\netcoreapp3.1\\CefSharp.BrowserSubprocess.exe"); + var architecture = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); + settings.BrowserSubprocessPath = Path.GetFullPath("..\\..\\..\\..\\..\\..\\CefSharp.BrowserSubprocess\\bin.netcore\\" + architecture + "\\Debug\\netcoreapp3.1\\CefSharp.BrowserSubprocess.exe"); #else + var architecture = Environment.Is64BitProcess ? "x64" : "x86"; settings.BrowserSubprocessPath = Path.GetFullPath("..\\..\\..\\..\\CefSharp.BrowserSubprocess\\bin\\" + architecture + "\\Debug\\CefSharp.BrowserSubprocess.exe"); #endif } @@ -210,7 +211,7 @@ public static void Init(CefSettingsBase settings, IBrowserProcessHandler browser #if !NETCOREAPP @"..\..\..\..\CefSharp.Example\Resources"; #else - @"..\..\..\..\..\CefSharp.Example\Resources"; + @"..\..\..\..\..\..\CefSharp.Example\Resources"; #endif settings.RegisterScheme(new CefCustomScheme diff --git a/CefSharp.Example/Handlers/BrowserProcessHandler.cs b/CefSharp.Example/Handlers/BrowserProcessHandler.cs index eb96ce04fc..11e0ab21e9 100644 --- a/CefSharp.Example/Handlers/BrowserProcessHandler.cs +++ b/CefSharp.Example/Handlers/BrowserProcessHandler.cs @@ -97,7 +97,7 @@ void IBrowserProcessHandler.OnContextInitialized() #if !NETCOREAPP @"..\..\..\..\CefSharp.Example\Resources"; #else - @"..\..\..\..\..\CefSharp.Example\Resources"; + @"..\..\..\..\..\..\CefSharp.Example\Resources"; #endif var folderSchemeHandlerExample = new FolderSchemeHandlerFactory(rootFolder: cefSharpExampleResourcesFolder, hostName: "cefsharp.example", //Optional param no hostname checking if null diff --git a/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj b/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj index b2b273c9dc..1be7304c60 100644 --- a/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj +++ b/CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj @@ -26,6 +26,11 @@ https://github.com/dotnet/docs/issues/12237 --> Major + win-x86;win-x64 + win-x86 + win-x64 + win-arm64 + false @@ -33,9 +38,7 @@ - - - + diff --git a/CefSharp.Test/CefSharp.Test.netcore.csproj b/CefSharp.Test/CefSharp.Test.netcore.csproj index 9d4f2ff101..115f2fe8c2 100644 --- a/CefSharp.Test/CefSharp.Test.netcore.csproj +++ b/CefSharp.Test/CefSharp.Test.netcore.csproj @@ -20,6 +20,11 @@ x86;x64;arm64 arm64 + win-x86;win-x64 + win-x86 + win-x64 + win-arm64 + false @@ -28,10 +33,8 @@ - - - - + + diff --git a/CefSharp.WinForms.Example/BrowserForm.cs b/CefSharp.WinForms.Example/BrowserForm.cs index 376129a5dd..65b5babb53 100644 --- a/CefSharp.WinForms.Example/BrowserForm.cs +++ b/CefSharp.WinForms.Example/BrowserForm.cs @@ -27,7 +27,11 @@ public BrowserForm(bool multiThreadedMessageLoopEnabled) { InitializeComponent(); +#if NETCOREAPP + var bitness = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); +#else var bitness = Environment.Is64BitProcess ? "x64" : "x86"; +#endif Text = "CefSharp.WinForms.Example - " + bitness; WindowState = FormWindowState.Maximized; diff --git a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj index c5d582ba0f..536c066f9a 100644 --- a/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj +++ b/CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj @@ -26,6 +26,11 @@ https://github.com/dotnet/docs/issues/12237 --> Major + win-x86;win-x64 + win-x86 + win-x64 + win-arm64 + false @@ -33,9 +38,7 @@ - - - + diff --git a/CefSharp.WinForms.Example/Minimal/SimpleBrowserForm.cs b/CefSharp.WinForms.Example/Minimal/SimpleBrowserForm.cs index 3b8bf02107..1c821a0404 100644 --- a/CefSharp.WinForms.Example/Minimal/SimpleBrowserForm.cs +++ b/CefSharp.WinForms.Example/Minimal/SimpleBrowserForm.cs @@ -25,7 +25,11 @@ public SimpleBrowserForm(bool multiThreadedMessageLoop, IFocusHandler customFocu Text = "CefSharp"; WindowState = FormWindowState.Maximized; +#if NETCOREAPP + var bitness = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); +#else var bitness = Environment.Is64BitProcess ? "x64" : "x86"; +#endif var version = String.Format("Chromium: {0}, CEF: {1}, CefSharp: {2}, Environment: {3}", Cef.ChromiumVersion, Cef.CefVersion, Cef.CefSharpVersion, bitness); DisplayOutput(version); diff --git a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.netcore.csproj b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.netcore.csproj index 674325ae3f..c5a441e46e 100644 --- a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.netcore.csproj +++ b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.netcore.csproj @@ -27,6 +27,11 @@ https://github.com/dotnet/docs/issues/12237 --> Major + win-x86;win-x64 + win-x86 + win-x64 + win-arm64 + false @@ -34,9 +39,7 @@ - - - + diff --git a/CefSharp.Wpf.Example/MainWindow.xaml.cs b/CefSharp.Wpf.Example/MainWindow.xaml.cs index 78464f1f3c..8bb8d45ce2 100644 --- a/CefSharp.Wpf.Example/MainWindow.xaml.cs +++ b/CefSharp.Wpf.Example/MainWindow.xaml.cs @@ -41,7 +41,11 @@ public MainWindow() Loaded += MainWindowLoaded; +#if NETCOREAPP + var bitness = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); +#else var bitness = Environment.Is64BitProcess ? "x64" : "x86"; +#endif Title += " - " + bitness; } diff --git a/CefSharp3.netcore.sln b/CefSharp3.netcore.sln index 255c894f73..881b29414b 100644 --- a/CefSharp3.netcore.sln +++ b/CefSharp3.netcore.sln @@ -168,13 +168,11 @@ Global {89540209-0C6D-4387-BE8A-7593B8D7784A}.Release|x86.ActiveCfg = Release|Any CPU {89540209-0C6D-4387-BE8A-7593B8D7784A}.Release|x86.Build.0 = Release|Any CPU {64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Debug|arm64.ActiveCfg = Debug|arm64 - {64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Debug|arm64.Build.0 = Debug|arm64 {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|arm64.ActiveCfg = Release|arm64 - {64E47346-0BB1-4DF7-B135-12D70E1F2F32}.Release|arm64.Build.0 = Release|arm64 {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 @@ -192,37 +190,31 @@ Global {FBFBD752-467C-444F-93E4-80D6242E8513}.Release|x86.ActiveCfg = Release|x86 {FBFBD752-467C-444F-93E4-80D6242E8513}.Release|x86.Build.0 = Release|x86 {E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Debug|arm64.ActiveCfg = Debug|arm64 - {E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Debug|arm64.Build.0 = Debug|arm64 {E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Debug|x64.ActiveCfg = Debug|x64 {E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Debug|x64.Build.0 = Debug|x64 {E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Debug|x86.ActiveCfg = Debug|x86 {E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Debug|x86.Build.0 = Debug|x86 {E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Release|arm64.ActiveCfg = Release|arm64 - {E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Release|arm64.Build.0 = Release|arm64 {E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Release|x64.ActiveCfg = Release|x64 {E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Release|x64.Build.0 = Release|x64 {E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Release|x86.ActiveCfg = Release|x86 {E73A3B0C-457E-4065-BCE9-A10CAA8F4F2A}.Release|x86.Build.0 = Release|x86 {A430C9D4-0952-44A2-989A-23C476B7A1F0}.Debug|arm64.ActiveCfg = Debug|arm64 - {A430C9D4-0952-44A2-989A-23C476B7A1F0}.Debug|arm64.Build.0 = Debug|arm64 {A430C9D4-0952-44A2-989A-23C476B7A1F0}.Debug|x64.ActiveCfg = Debug|x64 {A430C9D4-0952-44A2-989A-23C476B7A1F0}.Debug|x64.Build.0 = Debug|x64 {A430C9D4-0952-44A2-989A-23C476B7A1F0}.Debug|x86.ActiveCfg = Debug|x86 {A430C9D4-0952-44A2-989A-23C476B7A1F0}.Debug|x86.Build.0 = Debug|x86 {A430C9D4-0952-44A2-989A-23C476B7A1F0}.Release|arm64.ActiveCfg = Release|arm64 - {A430C9D4-0952-44A2-989A-23C476B7A1F0}.Release|arm64.Build.0 = Release|arm64 {A430C9D4-0952-44A2-989A-23C476B7A1F0}.Release|x64.ActiveCfg = Release|x64 {A430C9D4-0952-44A2-989A-23C476B7A1F0}.Release|x64.Build.0 = Release|x64 {A430C9D4-0952-44A2-989A-23C476B7A1F0}.Release|x86.ActiveCfg = Release|x86 {A430C9D4-0952-44A2-989A-23C476B7A1F0}.Release|x86.Build.0 = Release|x86 {51890C83-8FA3-4C9D-B3B7-A7DDF3C14A40}.Debug|arm64.ActiveCfg = Debug|arm64 - {51890C83-8FA3-4C9D-B3B7-A7DDF3C14A40}.Debug|arm64.Build.0 = Debug|arm64 {51890C83-8FA3-4C9D-B3B7-A7DDF3C14A40}.Debug|x64.ActiveCfg = Debug|x64 {51890C83-8FA3-4C9D-B3B7-A7DDF3C14A40}.Debug|x64.Build.0 = Debug|x64 {51890C83-8FA3-4C9D-B3B7-A7DDF3C14A40}.Debug|x86.ActiveCfg = Debug|x86 {51890C83-8FA3-4C9D-B3B7-A7DDF3C14A40}.Debug|x86.Build.0 = Debug|x86 {51890C83-8FA3-4C9D-B3B7-A7DDF3C14A40}.Release|arm64.ActiveCfg = Release|arm64 - {51890C83-8FA3-4C9D-B3B7-A7DDF3C14A40}.Release|arm64.Build.0 = Release|arm64 {51890C83-8FA3-4C9D-B3B7-A7DDF3C14A40}.Release|x64.ActiveCfg = Release|x64 {51890C83-8FA3-4C9D-B3B7-A7DDF3C14A40}.Release|x64.Build.0 = Release|x64 {51890C83-8FA3-4C9D-B3B7-A7DDF3C14A40}.Release|x86.ActiveCfg = Release|x86 From 79ffd8ede891b8da0083d9b1e93886c405f7958f Mon Sep 17 00:00:00 2001 From: kpreisser Date: Thu, 21 Jan 2021 21:18:41 +0100 Subject: [PATCH 4/6] Follow-Up: Update path to CefSharp.Test.dll. --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 0af25e0f63..171ae42d9a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -30,7 +30,7 @@ for: - ps: .\build.netcore.ps1 test_script: # Test our Release x64 build - dotnet test CefSharp.Test\bin.netcore\x64\Release\netcoreapp3.1\CefSharp.Test.dll + dotnet test CefSharp.Test\bin.netcore\x64\Release\netcoreapp3.1\win-x64\CefSharp.Test.dll artifacts: - path: NuGet\**\*.nupkg From 9aa39010656b1945de5e7ca584d927281f8d0a6d Mon Sep 17 00:00:00 2001 From: kpreisser Date: Fri, 22 Jan 2021 19:18:39 +0100 Subject: [PATCH 5/6] PR feedback: Also use RuntimeInformation for the .NET Framework example projects. --- CefSharp.Example/CefExample.cs | 4 ++-- CefSharp.WinForms.Example/BrowserForm.cs | 7 ++----- CefSharp.WinForms.Example/Minimal/SimpleBrowserForm.cs | 7 ++----- CefSharp.Wpf.Example/MainWindow.xaml.cs | 7 ++----- 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/CefSharp.Example/CefExample.cs b/CefSharp.Example/CefExample.cs index 511b854ff0..620d73b81f 100644 --- a/CefSharp.Example/CefExample.cs +++ b/CefSharp.Example/CefExample.cs @@ -5,6 +5,7 @@ using System; using System.Diagnostics; using System.IO; +using System.Runtime.InteropServices; using System.Text; using CefSharp.Example.Proxy; using CefSharp.SchemeHandler; @@ -168,11 +169,10 @@ public static void Init(CefSettingsBase settings, IBrowserProcessHandler browser if (DebuggingSubProcess) { + var architecture = RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); #if NETCOREAPP - var architecture = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); settings.BrowserSubprocessPath = Path.GetFullPath("..\\..\\..\\..\\..\\..\\CefSharp.BrowserSubprocess\\bin.netcore\\" + architecture + "\\Debug\\netcoreapp3.1\\CefSharp.BrowserSubprocess.exe"); #else - var architecture = Environment.Is64BitProcess ? "x64" : "x86"; settings.BrowserSubprocessPath = Path.GetFullPath("..\\..\\..\\..\\CefSharp.BrowserSubprocess\\bin\\" + architecture + "\\Debug\\CefSharp.BrowserSubprocess.exe"); #endif } diff --git a/CefSharp.WinForms.Example/BrowserForm.cs b/CefSharp.WinForms.Example/BrowserForm.cs index 65b5babb53..2aca0a82f5 100644 --- a/CefSharp.WinForms.Example/BrowserForm.cs +++ b/CefSharp.WinForms.Example/BrowserForm.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.IO; +using System.Runtime.InteropServices; using System.Threading.Tasks; using System.Windows.Forms; using CefSharp.Example; @@ -27,11 +28,7 @@ public BrowserForm(bool multiThreadedMessageLoopEnabled) { InitializeComponent(); -#if NETCOREAPP - var bitness = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); -#else - var bitness = Environment.Is64BitProcess ? "x64" : "x86"; -#endif + var bitness = RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); Text = "CefSharp.WinForms.Example - " + bitness; WindowState = FormWindowState.Maximized; diff --git a/CefSharp.WinForms.Example/Minimal/SimpleBrowserForm.cs b/CefSharp.WinForms.Example/Minimal/SimpleBrowserForm.cs index 1c821a0404..377ec6e912 100644 --- a/CefSharp.WinForms.Example/Minimal/SimpleBrowserForm.cs +++ b/CefSharp.WinForms.Example/Minimal/SimpleBrowserForm.cs @@ -4,6 +4,7 @@ using System; using System.ComponentModel; +using System.Runtime.InteropServices; using System.Windows.Forms; using CefSharp.Example.JavascriptBinding; @@ -25,11 +26,7 @@ public SimpleBrowserForm(bool multiThreadedMessageLoop, IFocusHandler customFocu Text = "CefSharp"; WindowState = FormWindowState.Maximized; -#if NETCOREAPP - var bitness = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); -#else - var bitness = Environment.Is64BitProcess ? "x64" : "x86"; -#endif + var bitness = RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); var version = String.Format("Chromium: {0}, CEF: {1}, CefSharp: {2}, Environment: {3}", Cef.ChromiumVersion, Cef.CefVersion, Cef.CefSharpVersion, bitness); DisplayOutput(version); diff --git a/CefSharp.Wpf.Example/MainWindow.xaml.cs b/CefSharp.Wpf.Example/MainWindow.xaml.cs index 8bb8d45ce2..69f30c5981 100644 --- a/CefSharp.Wpf.Example/MainWindow.xaml.cs +++ b/CefSharp.Wpf.Example/MainWindow.xaml.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; +using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; using System.Windows; @@ -41,11 +42,7 @@ public MainWindow() Loaded += MainWindowLoaded; -#if NETCOREAPP - var bitness = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); -#else - var bitness = Environment.Is64BitProcess ? "x64" : "x86"; -#endif + var bitness = RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); Title += " - " + bitness; } From 849a5c04b856c2e32191aad4c0840f5e6f384162 Mon Sep 17 00:00:00 2001 From: kpreisser Date: Fri, 22 Jan 2021 19:30:47 +0100 Subject: [PATCH 6/6] PR feedback: - Remove copying of CefRedist files in CefSharp.AfterBuild.targets which is no longer needed. - Update .vsconfig to include the VC ARM64 build tools. --- .vsconfig | 1 + CefSharp.AfterBuild.targets | 10 ---------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/.vsconfig b/.vsconfig index 3f6b512686..5d21fe1d60 100644 --- a/.vsconfig +++ b/.vsconfig @@ -17,6 +17,7 @@ "Microsoft.VisualStudio.Component.VC.CoreIde", "Microsoft.VisualStudio.Component.Windows10SDK", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", + "Microsoft.VisualStudio.Component.VC.Tools.ARM64", "Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites", "Microsoft.ComponentGroup.Blend", "Microsoft.VisualStudio.Workload.ManagedDesktop", diff --git a/CefSharp.AfterBuild.targets b/CefSharp.AfterBuild.targets index e70efc9357..b74676d6f1 100644 --- a/CefSharp.AfterBuild.targets +++ b/CefSharp.AfterBuild.targets @@ -15,14 +15,4 @@ - - - - - - - - - -