Blazor app Failed to load URL://localhost:8002/ #819

Closed
opened 2026-01-29 16:49:31 +00:00 by claunia · 1 comment
Owner

Originally created by @PPL-Ryan on GitHub (Aug 31, 2022).

Electron.NET CLI version: 13.5.1.0
Electron.NET API version: 13.5.1

  • Version:
    Node version: 18.7.0
  • Target:
    osx

I have an application built for windows and osx using ElectronNET and Blazor. Everything works fine on my windows machines but when I attempt to run the software on osx I got a blank white screen and the debug terminal says

"(node:14402) electron: Failed to load URL: http://localhost:8002/ with error: ERR_CONNECTION_REFUSED"

If I go to the menubar and click refresh the page loads and I get another message

"warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3]
Failed to determine the https port for redirect."

I've tried cleaning my project, deleting the bin and obj folders, deleting the .vs folder, turning off firewall, configuring chrome, checking proxies, etc. nothing has worked so far and I'm not sure what to do anymore.

Originally created by @PPL-Ryan on GitHub (Aug 31, 2022). <!-- Please search existing issues to avoid creating duplicates. --> <!-- Which version of Electron.NET CLI and API are you using? --> Electron.NET CLI version: 13.5.1.0 Electron.NET API version: 13.5.1 <!-- Please always try to use latest version before report. --> * **Version**: Node version: 18.7.0 <!-- Which version of .NET Core and Node.js are you using (if applicable)? --> <!-- What target are you building for? --> * **Target**: osx <!-- Enter your issue details below this comment. --> <!-- If you want, you can donate to increase issue priority (https://donorbox.org/electron-net) --> I have an application built for windows and osx using ElectronNET and Blazor. Everything works fine on my windows machines but when I attempt to run the software on osx I got a blank white screen and the debug terminal says "(node:14402) electron: Failed to load URL: http://localhost:8002/ with error: ERR_CONNECTION_REFUSED" If I go to the menubar and click refresh the page loads and I get another message "warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3] Failed to determine the https port for redirect." I've tried cleaning my project, deleting the bin and obj folders, deleting the .vs folder, turning off firewall, configuring chrome, checking proxies, etc. nothing has worked so far and I'm not sure what to do anymore.
claunia added the bug label 2026-01-29 16:49:31 +00:00
Author
Owner

@PPL-Ryan commented on GitHub (Sep 9, 2022):

changing this line

var browserWindow = await Electron.WindowManager.CreateWindowAsync(browserWindowOptions);

to this

async void CreateWindow()
{
var window = await Electron.WindowManager.CreateWindowAsync(browserWindowOptions);
window.OnClosed += () => {
Electron.App.Quit();
};
}

fixed the issue

@PPL-Ryan commented on GitHub (Sep 9, 2022): changing this line var browserWindow = await Electron.WindowManager.CreateWindowAsync(browserWindowOptions); to this async void CreateWindow() { var window = await Electron.WindowManager.CreateWindowAsync(browserWindowOptions); window.OnClosed += () => { Electron.App.Quit(); }; } fixed the issue
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#819