Skip to content

Commit 31a5971

Browse files
committed
PR feedback: Switch the CefSharp.*.Example.netcore projects from cef.redist to chromiumembeddedframework.runtime.
1 parent 74e9f78 commit 31a5971

File tree

8 files changed

+32
-13
lines changed

8 files changed

+32
-13
lines changed

CefSharp.Example/CefExample.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,11 @@ public static void Init(CefSettingsBase settings, IBrowserProcessHandler browser
168168

169169
if (DebuggingSubProcess)
170170
{
171-
var architecture = Environment.Is64BitProcess ? "x64" : "x86";
172171
#if NETCOREAPP
173-
settings.BrowserSubprocessPath = Path.GetFullPath("..\\..\\..\\..\\..\\CefSharp.BrowserSubprocess\\bin.netcore\\" + architecture + "\\Debug\\netcoreapp3.1\\CefSharp.BrowserSubprocess.exe");
172+
var architecture = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant();
173+
settings.BrowserSubprocessPath = Path.GetFullPath("..\\..\\..\\..\\..\\..\\CefSharp.BrowserSubprocess\\bin.netcore\\" + architecture + "\\Debug\\netcoreapp3.1\\CefSharp.BrowserSubprocess.exe");
174174
#else
175+
var architecture = Environment.Is64BitProcess ? "x64" : "x86";
175176
settings.BrowserSubprocessPath = Path.GetFullPath("..\\..\\..\\..\\CefSharp.BrowserSubprocess\\bin\\" + architecture + "\\Debug\\CefSharp.BrowserSubprocess.exe");
176177
#endif
177178
}
@@ -210,7 +211,7 @@ public static void Init(CefSettingsBase settings, IBrowserProcessHandler browser
210211
#if !NETCOREAPP
211212
@"..\..\..\..\CefSharp.Example\Resources";
212213
#else
213-
@"..\..\..\..\..\CefSharp.Example\Resources";
214+
@"..\..\..\..\..\..\CefSharp.Example\Resources";
214215
#endif
215216

216217
settings.RegisterScheme(new CefCustomScheme

CefSharp.Example/Handlers/BrowserProcessHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void IBrowserProcessHandler.OnContextInitialized()
9797
#if !NETCOREAPP
9898
@"..\..\..\..\CefSharp.Example\Resources";
9999
#else
100-
@"..\..\..\..\..\CefSharp.Example\Resources";
100+
@"..\..\..\..\..\..\CefSharp.Example\Resources";
101101
#endif
102102
var folderSchemeHandlerExample = new FolderSchemeHandlerFactory(rootFolder: cefSharpExampleResourcesFolder,
103103
hostName: "cefsharp.example", //Optional param no hostname checking if null

CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,18 @@
2626
https://github.com/dotnet/docs/issues/12237
2727
-->
2828
<RollForward>Major</RollForward>
29+
<RuntimeIdentifier Condition="'$(Platform)' == 'x86'">win-x86</RuntimeIdentifier>
30+
<RuntimeIdentifier Condition="'$(Platform)' == 'x64'">win-x64</RuntimeIdentifier>
31+
<RuntimeIdentifier Condition="'$(Platform)' == 'arm64'">win-arm64</RuntimeIdentifier>
32+
<SelfContained Condition="'$(Configuration)' == 'Debug'">false</SelfContained>
2933
</PropertyGroup>
3034

3135
<ItemGroup>
3236
<ProjectReference Include="..\CefSharp.Core\CefSharp.Core.netcore.csproj" />
3337
<ProjectReference Include="..\CefSharp.Example\CefSharp.Example.netcore.csproj" />
3438
<ProjectReference Include="..\CefSharp.OffScreen\CefSharp.OffScreen.netcore.csproj" />
3539
<ProjectReference Include="..\CefSharp\CefSharp.netcore.csproj" />
36-
<PackageReference Include="cef.redist.x86" Version="88.1.3" />
37-
<PackageReference Include="cef.redist.x64" Version="88.1.3" />
38-
<PackageReference Include="cef.redist.arm64" Version="88.1.3" />
40+
<PackageReference Include="chromiumembeddedframework.runtime" Version="88.1.3" />
3941
</ItemGroup>
4042

4143
<ItemGroup>

CefSharp.WinForms.Example/BrowserForm.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ public BrowserForm(bool multiThreadedMessageLoopEnabled)
2727
{
2828
InitializeComponent();
2929

30+
#if NETCOREAPP
31+
var bitness = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant();
32+
#else
3033
var bitness = Environment.Is64BitProcess ? "x64" : "x86";
34+
#endif
3135
Text = "CefSharp.WinForms.Example - " + bitness;
3236
WindowState = FormWindowState.Maximized;
3337

CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,18 @@
2626
https://github.com/dotnet/docs/issues/12237
2727
-->
2828
<RollForward>Major</RollForward>
29+
<RuntimeIdentifier Condition="'$(Platform)' == 'x86'">win-x86</RuntimeIdentifier>
30+
<RuntimeIdentifier Condition="'$(Platform)' == 'x64'">win-x64</RuntimeIdentifier>
31+
<RuntimeIdentifier Condition="'$(Platform)' == 'arm64'">win-arm64</RuntimeIdentifier>
32+
<SelfContained Condition="'$(Configuration)' == 'Debug'">false</SelfContained>
2933
</PropertyGroup>
3034

3135
<ItemGroup>
3236
<ProjectReference Include="..\CefSharp.Core\CefSharp.Core.netcore.csproj" />
3337
<ProjectReference Include="..\CefSharp.Example\CefSharp.Example.netcore.csproj" />
3438
<ProjectReference Include="..\CefSharp.WinForms\CefSharp.WinForms.netcore.csproj" />
3539
<ProjectReference Include="..\CefSharp\CefSharp.netcore.csproj" />
36-
<PackageReference Include="cef.redist.x86" Version="88.1.3" />
37-
<PackageReference Include="cef.redist.x64" Version="88.1.3" />
38-
<PackageReference Include="cef.redist.arm64" Version="88.1.3" />
40+
<PackageReference Include="chromiumembeddedframework.runtime" Version="88.1.3" />
3941
</ItemGroup>
4042

4143
<ItemGroup>

CefSharp.WinForms.Example/Minimal/SimpleBrowserForm.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ public SimpleBrowserForm(bool multiThreadedMessageLoop, IFocusHandler customFocu
2525
Text = "CefSharp";
2626
WindowState = FormWindowState.Maximized;
2727

28+
#if NETCOREAPP
29+
var bitness = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant();
30+
#else
2831
var bitness = Environment.Is64BitProcess ? "x64" : "x86";
32+
#endif
2933
var version = String.Format("Chromium: {0}, CEF: {1}, CefSharp: {2}, Environment: {3}", Cef.ChromiumVersion, Cef.CefVersion, Cef.CefSharpVersion, bitness);
3034
DisplayOutput(version);
3135

CefSharp.Wpf.Example/CefSharp.Wpf.Example.netcore.csproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,18 @@
2727
https://github.com/dotnet/docs/issues/12237
2828
-->
2929
<RollForward>Major</RollForward>
30+
<RuntimeIdentifier Condition="'$(Platform)' == 'x86'">win-x86</RuntimeIdentifier>
31+
<RuntimeIdentifier Condition="'$(Platform)' == 'x64'">win-x64</RuntimeIdentifier>
32+
<RuntimeIdentifier Condition="'$(Platform)' == 'arm64'">win-arm64</RuntimeIdentifier>
33+
<SelfContained Condition="'$(Configuration)' == 'Debug'">false</SelfContained>
3034
</PropertyGroup>
3135

3236
<ItemGroup>
3337
<ProjectReference Include="..\CefSharp.Core\CefSharp.Core.netcore.csproj" />
3438
<ProjectReference Include="..\CefSharp.Example\CefSharp.Example.netcore.csproj" />
3539
<ProjectReference Include="..\CefSharp.Wpf\CefSharp.Wpf.netcore.csproj" />
3640
<ProjectReference Include="..\CefSharp\CefSharp.netcore.csproj" />
37-
<PackageReference Include="cef.redist.x86" Version="88.1.3" />
38-
<PackageReference Include="cef.redist.x64" Version="88.1.3" />
39-
<PackageReference Include="cef.redist.arm64" Version="88.1.3" />
41+
<PackageReference Include="chromiumembeddedframework.runtime" Version="88.1.3" />
4042
</ItemGroup>
4143

4244
<ItemGroup>

CefSharp.Wpf.Example/MainWindow.xaml.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ public MainWindow()
4141

4242
Loaded += MainWindowLoaded;
4343

44+
#if NETCOREAPP
45+
var bitness = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant();
46+
#else
4447
var bitness = Environment.Is64BitProcess ? "x64" : "x86";
48+
#endif
4549
Title += " - " + bitness;
4650
}
4751

0 commit comments

Comments
 (0)