OutSystems/CefGlue

CefGlue.Demo.Avalonia crash at startup

Closed this issue · 8 comments

sakya commented

When launching the CefGlue.Demo.Avalonia the app crash before displaying anything.

I built from source and when I execute CefGlue.Demo.Avalonia I get this error (the app crash)

[1028/110000.215:WARNING:resource_util.cc(94)] Please customize CefSettings.root_cache_path for your application. Use of the default value may lead to unintended process singleton behavior.
[1028/110000.217:WARNING:resource_bundle.cc(464)] locale_file_path.empty() for locale 
[1028/110000.217:ERROR:alloy_main_delegate.cc(716)] Could not load locale pak for en-US
[1028/110000.222:WARNING:resource_bundle.cc(1199)] locale resources are not loaded

Process finished with exit code -1,073,741,819

Which operating system?

sakya commented

Ops, sorry: Windows 11

sakya commented

BTW also CefGlue.Demo.WPF crash with the same output

sakya commented

It works if I initialize Cef like this

        static int Main(string[] args)
        {
            var dataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefGlue.Demo.Avalonia");
            if (!Directory.Exists(dataPath))
                Directory.CreateDirectory(dataPath);

            AppBuilder.Configure<App>()
                      .UsePlatformDetect()
                      .With(new Win32PlatformOptions()
                      {
                          // CompositionMode = new [] { Win32CompositionMode.WinUIComposition }
                      })
                      .AfterSetup(_ => CefRuntimeLoader.Initialize(new CefSettings() {
                              RootCachePath = Path.Combine(dataPath, "cache"),
                              CachePath = Path.Combine(dataPath, "cache", "CefGlue.Demo.Avalonia"), 
#if WINDOWLESS
                          WindowlessRenderingEnabled = true,
#else
                          WindowlessRenderingEnabled = false,
#endif
                        LogSeverity = CefLogSeverity.Debug
                      },
                      customSchemes: new[] {
                        new CustomScheme()
                        {
                            SchemeName = "test",
                            SchemeHandlerFactory = new CustomSchemeHandler()
                        }
                      }))
                      .StartWithClassicDesktopLifetime(args);

            return 0;
        }

Are you running the main branch pristine?

sakya commented

Yes, I only had to change this path because I have VS professional

<VcvarsLocation Condition="!Exists($(DevEnvDir))">C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\</VcvarsLocation> <!-- Path used in Microsoft-hosted agents -->

According to this:
https://www.magpcss.org/ceforum/viewtopic.php?f=6&t=19665

it seems that you tried to run 2 instances. was that right?

Both problems have been addressed