theolivenbaum / electron-sharp

MIT License
24 stars 4 forks source link

The window closes on the Linux (Debian) platform #29

Open Tartilla-TAIGO opened 3 months ago

Tartilla-TAIGO commented 3 months ago

Platform: Linux

If you do not specify loadUrl when starting the window, it may make it impossible to open the window on Linux (Debian). The application simply closes, although this does not happen on Windows.

A temporary solution:

    builder.WebHost.UseUrls("http://localhost:20045");
    ... 
        var browserWindow = await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions
    {
        Width = 1152,
        Height = 940,
    }, "http://localhost:20045");
markatosi commented 2 months ago

This also resolves an issue when running on an intel Mac although the electron window does display the Blazor content will not be rendered without explicitly setting the Url as you have described.