Open sam-wheat opened 1 year ago
In this issue it was requested to copy the project source to Ubunto and build. I did that - here is what I got:
sam@UGLY:~/stuff/BlazorServerTest1$ dotnet build
MSBuild version 17.3.2+561848881 for .NET Determining projects to restore... Restored /home/sam/stuff/BlazorServerTest1/BlazorServerTest1.csproj (in 458 ms). BlazorServerTest1 -> /home/sam/stuff/BlazorServerTest1/bin/Debug/net6.0/BlazorServerTest1.dll
Build succeeded. 0 Warning(s) 0 Error(s)
Time Elapsed 00:00:03.73
sam@UGLY:~/stuff/BlazorServerTest1$ electronize start
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... Restored /home/sam/stuff/BlazorServerTest1/BlazorServerTest1.csproj (in 473 ms). 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 /usr/bin/env: ‘bash\r’: No such file or directory
ElectronHostHook handling started... Invoke electron - in dir: /home/sam/stuff/BlazorServerTest1/obj/Host/node_modules/.bin ./electron "../../main.js" Unhandled exception. System.AggregateException: One or more errors occurred. (An error occurred trying to start process '/usr/bin/bash' with working directory '/home/sam/stuff/BlazorServerTest1/obj/Host/node_modules/.bin'. No such file or directory) ---> System.ComponentModel.Win32Exception (2): An error occurred trying to start process '/usr/bin/bash' with working directory '/home/sam/stuff/BlazorServerTest1/obj/Host/node_modules/.bin'. No such file or directory at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec) at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at ElectronNET.CLI.ProcessHelper.CmdExecute(String command, String workingDirectoryPath, Boolean output, Boolean waitForExit) in C:_PrivateRepo\Electron.NET\ElectronNET.CLI\ProcessHelper.cs:line 40 at ElectronNET.CLI.Commands.StartElectronCommand.
b17_0() in C:_PrivateRepo\Electron.NET\ElectronNET.CLI\Commands\StartElectronCommand.cs:line 178 at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.<>c.<.cctor>b272_0(Object obj) at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task 1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task
1.get_Result() at ElectronNET.CLI.Program.Main(String[] args) in C:_PrivateRepo\Electron.NET\ElectronNET.CLI\Program.cs:line 59 Aborted
I fixed the npm error using the answer to this question.
Tried to run my app from source again at Ubunto terminal prompt:
sam@UGLY:~/stuff/BlazorServerTest1$ electronize start
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 fund
for details
found 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.
"Kestrel": {
"EndPoints": {
"Http": {
"Url": "http://localhost:8001"
}
}
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
@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.
@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?
@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 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.
Trying building it with "electonize build /target linux". Then nagivate down to "bin/Desktop/linux-unpacked" and try to run the binary.
@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.
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: @.***>
Same as @sam-wheat , I punted on Linux support and jumped over to MAUI.
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\BlazorServerTest1
In 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.