Skip to content

CefSettings.BrowserSubprocessPath not found while Enabling Self-Contained and PublishSingleFile #5019

Description

@Shiroiame-Kusu

Is there an existing issue for this?

  • I have searched both open/closed issues, no issue already exists.

CefSharp Version

131.3.50

Operating System

Windows 11

Architecture

x64

.Net Version

.Net 6.0

Implementation

WPF

Reproduction Steps

This issue is not really reproducible, only presistently occurs on some of the computers without any reasons.
Maybe Similar to #4151 ?

Expected behavior

Runs Normally.

Actual behavior

12/25/2024 10:59:10 PM  |  2.4.0 - Alpha  |  NET6.0.36
System.IO.FileNotFoundException: CefSettings.BrowserSubprocessPath not found.
File name: 'C:\Users\kusu\AppData\Local\Temp\.net\Kairo\+6HcWqeWNh2UcAbMK9QtgCKKPirpgHE=\CEF'
   at CefSharp.Core.Cef.Initialize(CefSettingsBase cefSettings, Boolean performDependencyCheck, IApp cefApp)
   at CefSharp.Core.Cef.Initialize(CefSettingsBase cefSettings)
   at CefSharp.Cef.Initialize(CefSettingsBase settings) in C:\projects\cefsharp\CefSharp.Core\Cef.cs:line 123
   at Kairo.Dashboard.Home.InitializeCustomComponents() in D:\GitHub\Kairo\Kairo\Dashboard\Home.xaml.cs:line 78
   at Kairo.Dashboard.Home..ctor() in D:\GitHub\Kairo\Kairo\Dashboard\Home.xaml.cs:line 39
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.IO.FileNotFoundException: CefSettings.BrowserSubprocessPath not found.
File name: 'C:\Users\kusu\AppData\Local\Temp\.net\Kairo\+6HcWqeWNh2UcAbMK9QtgCKKPirpgHE=\CEF'
   at CefSharp.Core.Cef.Initialize(CefSettingsBase cefSettings, Boolean performDependencyCheck, IApp cefApp)
   at CefSharp.Core.Cef.Initialize(CefSettingsBase cefSettings)
   at CefSharp.Cef.Initialize(CefSettingsBase settings) in C:\projects\cefsharp\CefSharp.Core\Cef.cs:line 123
   at Kairo.Dashboard.Home.InitializeCustomComponents() in D:\GitHub\Kairo\Kairo\Dashboard\Home.xaml.cs:line 78
   at Kairo.Dashboard.Home..ctor() in D:\GitHub\Kairo\Kairo\Dashboard\Home.xaml.cs:line 39
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.ConstructorInfo.Invoke(Object[] parameters)
   at Wpf.Ui.Services.Internal.NavigationServiceActivator.CreateInstance(Type pageType, Object dataContext)
   at Wpf.Ui.Services.Internal.NavigationService.CreateFrameworkElementInstance(Type pageType, Object dataContext)
   at Wpf.Ui.Services.Internal.NavigationService.NavigateInternalByItemWithCache(Int32 serviceItemId, Object dataContext)
   at Wpf.Ui.Services.Internal.NavigationService.NavigateInternal(Int32 serviceItemId, Object dataContext)
   at Wpf.Ui.Services.Internal.NavigationService.Navigate(Int32 pageId, Object dataContext)
   at Wpf.Ui.Controls.Navigation.NavigationBase.Navigate(Int32 pageId, Object dataContext)
   at Wpf.Ui.Controls.Navigation.NavigationBase.Navigate(Int32 pageId)
   at Wpf.Ui.Controls.Navigation.NavigationBase.OnLoaded(Object sender, RoutedEventArgs e)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
   at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
   at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.Resize(ICompositionTarget resizedCompositionTarget)
   at System.Windows.Interop.HwndTarget.OnResize()
   at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

And the fact is, I already defined the BrowserSubprocessPath in the setting.
image

Regression?

Not really, previous build also has this problem.

Known Workarounds

Nop.

Does this problem also occur in the CEF Sample Application

No

Other information

The code I execute to compile:
dotnet publish "Kairo/Kairo.csproj" -f net6.0-windows -r win-x64 -p:PublishSingleFile=true -p:RuntimeIdentifier=win-x64 -p:IncludeContentInSingleFile=true -p:Configuration=Release --sc -p:IncludeAllContentForSelfExtract=true -p:EnableCompressionInSingleFile=true
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions