Net 5+ - Self Host the BrowserSubProcess for SelfContained builds

- Use the application exe instead of CefSharp.BrowserSubprocess.exe
- M103 will add a new CefSharpExcludeSubProcessExe which will
  exclude the exe from builds
This commit is contained in:
Alex Maitland 2022-06-16 11:13:49 +10:00
parent 8f3bba483c
commit 1d99718498
2 changed files with 18 additions and 0 deletions

View File

@ -39,6 +39,15 @@
<StartupObject>CefSharp.MinimalExample.WinForms.ProgramPublishSingleFile</StartupObject> <StartupObject>CefSharp.MinimalExample.WinForms.ProgramPublishSingleFile</StartupObject>
</PropertyGroup> </PropertyGroup>
<!--
For SelfContained we'll self host the BrowserSubprocess (use the applications own exe)
Instead of the provdied CefSharp.BrowserSubprocess.exe
-->
<PropertyGroup Condition="('$(TargetFramework)' == 'net5.0-windows' OR '$(TargetFramework)' == 'net6.0-windows') AND '$(SelfContained)' == 'true'">
<StartupObject>CefSharp.MinimalExample.WinForms.ProgramPublishSingleFile</StartupObject>
<CefSharpExcludeSubProcessExe>true</CefSharpExcludeSubProcessExe>
</PropertyGroup>
<PropertyGroup Condition="'$(PlatformTarget)' == 'x86'"> <PropertyGroup Condition="'$(PlatformTarget)' == 'x86'">
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''">win-x86</RuntimeIdentifier> <RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''">win-x86</RuntimeIdentifier>
<SelfContained Condition="'$(SelfContained)' == ''">false</SelfContained> <SelfContained Condition="'$(SelfContained)' == ''">false</SelfContained>

View File

@ -50,6 +50,15 @@
<StartupObject>CefSharp.MinimalExample.Wpf.ProgramPublishSingleFile</StartupObject> <StartupObject>CefSharp.MinimalExample.Wpf.ProgramPublishSingleFile</StartupObject>
</PropertyGroup> </PropertyGroup>
<!--
For SelfContained we'll self host the BrowserSubprocess (use the applications own exe)
Instead of the provdied CefSharp.BrowserSubprocess.exe
-->
<PropertyGroup Condition="('$(TargetFramework)' == 'net5.0-windows' OR '$(TargetFramework)' == 'net6.0-windows') AND '$(SelfContained)' == 'true'">
<StartupObject>CefSharp.MinimalExample.Wpf.ProgramPublishSingleFile</StartupObject>
<CefSharpExcludeSubProcessExe>true</CefSharpExcludeSubProcessExe>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Remove="bin\**" /> <Compile Remove="bin\**" />
<Compile Remove="obj\**" /> <Compile Remove="obj\**" />