mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
ERR_ELECTRON_BUILDER_CANNOT_EXECUTE when trying to build a desktop app for Ubunto #884
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sam-wheat on GitHub (Apr 25, 2023).
I believe I am having a similar problem to what is found here and here. The error message I get is different so I will write a new issue. My goal is to produce a desktop app that will run on Linux. Per this issue I think what I am doing is supported.
Environment:
Windows 10 22H2 19045.2846
Visual Studio 2022 / latest
Unbutu running on WSL2 same physical machine as Windows
dotnet, node and x11 are installed. xeyes/gedit runs correctly.
My app is Hello World, only mods from default Blazor template are to install Electron.Net
Electron.Net versions 23.6.1 and 23.6.2-alpha-13 - both give same result.
Steps to reproduce
On Windows open command line in .csproj folder:
This works fine - Blazor runs in an Electron window.
In same command window:
Despite the above error msg binaries are still produced in
bin\Desktop\linux-unpacked\resources\bin.Copy files in folder above to home folder in WSL file subsystem. In my case this is
\\wsl.localhost\Ubuntu\home\sam\stuff\BlazorServerTest1In a terminal window on the Linux VM run the following:
Am I supposed to have a HTTP server runing on the Linux machine? Error message references files on my windows machine.... IDK why.
@sam-wheat commented on GitHub (Apr 25, 2023):
In this issue it was requested to copy the project source to Ubunto and build. I did that - here is what I got:
@sam-wheat commented on GitHub (Apr 25, 2023):
I fixed the npm error using the answer to this question.
Tried to run my app from source again at Ubunto terminal prompt:
Start Electron Desktop Application...
Arguments:
dotnet publish -r linux-x64 -c "Debug" --output "/home/sam/stuff/BlazorServerTest1/obj/Host/bin" /p:PublishReadyToRun=true /p:PublishSingleFile=true --no-self-contained
MSBuild version 17.3.2+561848881 for .NET
Determining projects to restore...
All projects are up-to-date for restore.
BlazorServerTest1 -> /home/sam/stuff/BlazorServerTest1/bin/Debug/net6.0/linux-x64/BlazorServerTest1.dll
BlazorServerTest1 -> /home/sam/stuff/BlazorServerTest1/obj/Host/bin/
node_modules missing in: /home/sam/stuff/BlazorServerTest1/obj/Host/node_modules
Start npm install...
npm install
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'image-size@1.0.2',
npm WARN EBADENGINE required: { node: '>=14.0.0' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
up to date, audited 153 packages in 815ms
22 packages are looking for funding
run
npm fundfor detailsfound 0 vulnerabilities
ElectronHostHook handling started...
Invoke electron - in dir: /home/sam/stuff/BlazorServerTest1/obj/Host/node_modules/.bin
./electron "../../main.js"
Electron Socket IO Port: 8000
Electron Socket started on port 8000 at ::1
ASP.NET Core Port: 8001
[1185:0424/180630.352942:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization
[1235:0424/180630.428464:ERROR:gpu_memory_buffer_support_x11.cc(49)] dri3 extension not supported.
stdout: Use Electron Port: 8000
ASP.NET Core Application connected... global.electronsocket vs057hfhE7d3iR9xAAAC 2023-04-25T01:06:30.707Z
stdout: BridgeConnector connected!
stdout: Called Event BrowserWindowCreated - data 1
(node:1158) electron: Failed to load URL: http://localhost:8001/ with error: ERR_CONNECTION_REFUSED
(Use
electron --trace-warnings ...to show where the warning was created)stdout: info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://localhost:8001
stdout: ASP.NET Core host has fully started.
stdout: info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
stdout: info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
Content root path: /home/sam/stuff/BlazorServerTest1/obj/Host/bin/
Electron can't find my app but when I go to http://localhost:8001/ in my browser my app loads immediately without error.
@andrewschuler commented on GitHub (Apr 25, 2023):
I'm getting the exact same error on ubuntu with the demo api app. I just created an issue over there a few minutes ago before I saw this.
Frankly I've been working for several days to get ANY type of project to run or build on Linux with no success. If you figure this out PLEASE let me know.
I've tried creating various types of new dotnet projects, then "electronizing" them. They all work on Windows but none work on Linux. All with different types of errors. I was hoping to use Linux as a build server to target Mac but this is a bit dis-heartening.
This error seems to be related to the graphics driver? My ubuntu instance is a VM running in Hyper-V
@sam-wheat commented on GitHub (Apr 25, 2023):
@andrewschuler Andrew, you may want to try Photiono. I had problems with it initially, but they released a new build in the last few days. I just got a basic hello world app running on both Windows and Ubunto.
@andrewschuler commented on GitHub (Apr 25, 2023):
@sam-wheat Thanks for that.
Some more information for you as well. All the errors I've been seeing have been with "electronize start". However I just tried to build the project with "electronize build /target linux" on Ubuntu. That builds successfully with the errors and the app runs as it should. From this experience it seems maybe 'electronize start' should only be used on Windows?
@sam-wheat commented on GitHub (Apr 25, 2023):
@andrewschuler I'm just another user so I can't offer any guidance. You made it further than I did however. I was never able to get it to run on linux even if I built it on the linux machine.
@andrewschuler commented on GitHub (Apr 25, 2023):
Trying building it with "electonize build /target linux". Then nagivate down to "bin/Desktop/linux-unpacked" and try to run the binary.
@LapinskasL commented on GitHub (Jun 27, 2024):
@andrewschuler and @sam-wheat, did any of you find a solution? I'm getting the
SocketIOClient.ConnectionException: Cannot connect to server 'http://localhost/'error, but on Windows.@sam-wheat commented on GitHub (Jun 27, 2024):
I ended up using a different platform and have not looked back. See my link to Photino above.
From: Lukas Lapinskas @.>
Sent: Thursday, June 27, 2024 8:06 AM
To: ElectronNET/Electron.NET @.>
Cc: Sam Wheat @.>; Mention @.>
Subject: Re: [ElectronNET/Electron.NET] ERR_ELECTRON_BUILDER_CANNOT_EXECUTE when trying to build a desktop app for Ubunto (Issue #770)
@andrewschulerhttps://github.com/andrewschuler and @sam-wheathttps://github.com/sam-wheat, did any of you find a solution? I'm getting the SocketIOClient.ConnectionException: Cannot connect to server 'http://localhost/' error, but on Windows.
—
Reply to this email directly, view it on GitHubhttps://github.com/ElectronNET/Electron.NET/issues/770#issuecomment-2194966984, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEA2LWQMYFXRBKD3Z6DWVZTZJQS5XAVCNFSM6AAAAABKAEDCQWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJUHE3DMOJYGQ.
You are receiving this because you were mentioned.Message ID: @.***>
@andrewschuler commented on GitHub (Jun 27, 2024):
Same as @sam-wheat , I punted on Linux support and jumped over to MAUI.
@noamyogev84 commented on GitHub (Jul 13, 2025):
Same error here.
Trying to electronize my NET7 application, with no success, not building nor with start command.
It gives me constantly:
stdout: SocketIOClient.ConnectionException: Cannot connect to server 'http://localhost/'
---> System.TimeoutException: The operation has timed out.
--- End of inner exception stack trace ---
at SocketIOClient.SocketIO.ConnectAsync()
at ElectronNET.API.SocketIoFacade.Connect()
at ElectronNET.API.BridgeConnector.get_Socket()
at ElectronNET.API.WindowManager.CreateWindowAsync(BrowserWindowOptions options, String loadUrl)
@FlorianRappl commented on GitHub (Nov 1, 2025):
Outdated - use
ElectronNET.CoreandElectronNET.Core.AspNet.See Wiki / What's New.