mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-04 13:44:47 +00:00
Application UI does not start on some laptops. No log or error #724
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 @hemantsathe on GitHub (Nov 9, 2021).
Originally assigned to: @GregorBiswanger on GitHub.
We have built an app using Electron.NET and ASP.NET on .Net 5. This app does not run on our client's laptop and on one more laptop but otherwise runs on developer/ non-developer machines and VMs otherwise.
We have found that the async call to CreateBrowserWindowAsync call fails on these machines but it does not throw any error. We have wrapped it in try catch, assigned the call to a task and awaited the task. However, the task simply does not launch or complete at all. There is no log available. Nothing in the event viewer as well.
Here is the code snippet
In the event viewer though we have found that the call to AppName.exe does not get called with --type=renderer parameter on these machine whereas on the other machines it does call with renderer parameter and the UI is visible.
We are not able to trace the root cause and as this is not running on client's laptop, he is likely to cancel the project.
What we expect is to at least be able to get the root cause of the issue.
TIA
Hemant
@hemantsathe commented on GitHub (Nov 15, 2021):
@GregorBiswanger - Please help or assign this to someone.
Thanks.
@bman46 commented on GitHub (Nov 21, 2021):
Any details about the devices in question (os/model)? I have noticed that when debugging on my m1 mac it will occasionally open the app but not launch the main window. It gets stuck after it prints
ASP.NET Core Port: 8001and doesn't get to the point where it would printstdout: Use Electron Port: 8000. No errors are printed, even with /watch. I havent been able to get that to happen in any builds, however. Just withelectronize /start.@ziadakiki commented on GitHub (Nov 21, 2021):
I can confirm that I get the same behavior on Windows with .net 6/13.5.1. Another project using .net 5 and version 9 of Electron.NET works fine.
@trdsolutions commented on GitHub (Nov 29, 2021):
I have the same situation. I can start it from visual studio by invoking
electronize /start, but after building it usingelectronize /buildwhich succeeds, the application starts, but without a window. As @ziadakiki already mentioned, I also think, that this can be in relation to a .NET 6 SDK installation, but I really need a fix or workaround for this.@UicoCastol commented on GitHub (Nov 29, 2021):
Experience the same thing, in some laptos wont start
@danatcofo commented on GitHub (Dec 7, 2021):
Can I get a list of OS & Languages (Default os language that is) that you all are experiencing this on as well as your build properties...i.e. whats passed to
electronize buildAlso... do the machines experiencing this issue have the .net 5 runtime installed on them? you can determine whats installed on the machines by running
dotnet --info@ziadakiki commented on GitHub (Dec 7, 2021):
Hello,
electronize build@danatcofo commented on GitHub (Dec 7, 2021):
Ok... so we can try a something here to hopefully see whats happening... Assuming that you didn't change any ports...
obviously substituting the
appname.exefor your application name. If you did change the default ports, updated accordingly.Observe the output...
One of the issues that we have an open PR for #592 is that we don't capture the error output from the net core application, we only capture the default output. This is a workaround to see what errors may be thrown that are not captured during startup.
@ziadakiki commented on GitHub (Dec 8, 2021):
Here's my console output when running this command:
Nothing else happens.
@danatcofo commented on GitHub (Dec 8, 2021):
hmm... what I see is that it thinks its a net6 app when it should be a net5 app, we haven't added support for ElectronNET to run under net6
Can you try building with the following command.
electronize build /PublishReadyToRun true. What this should do is package up all the dependencies such that there is no external dependencies on having any sdks or runtimes installed on the machines installed to.@ziadakiki commented on GitHub (Dec 8, 2021):
I guess this should be the issue. I'm targeting .net 6.
I tried building with the mentioned command, it generated an installer. After installing, I tried to open the app and it did not work.
Any timeframe for the .net 6 support? Is it something I can help with?
@danatcofo commented on GitHub (Dec 8, 2021):
I don't think we have a ticket open for it at the moment... BUT it is an open source project and if you wanted to do the work of creating the support go ahead. I think in the past we've just pushed the version ahead and dropped support for older versions of .net. Personally I'd rather NOT do that as its very disruptive for consumers.
@danatcofo commented on GitHub (Dec 9, 2021):
NET6 support added in #636
@ziadakiki commented on GitHub (Dec 9, 2021):
Hi @danatcofo that's great. So the issue turned out to be solely from the
System.Drawing.Colornamespace?@danatcofo commented on GitHub (Dec 9, 2021):
Its likely due to the
System.Drawing.Commondependency inElectronNET.APIand the v5 dependencies thereof... Feel free to pull a local copy of the PR source and build off of that. You'll have to add a local nuget package source to pick up the API reference generated when you build the source.@hemantsathe commented on GitHub (Dec 10, 2021):
Apologies for a late response on that. We are using Windows 10 with .Net 5. This is in a large enterprise with their standard image. The app runs fine on most devices but fails on two laptops without any trace of issue. Total silence. Since this was only on end user machine we did not have much tooling support either.
Our client was upset with this and felt it is a supportability issue as his users are spread out across globe and not too many in number. We finally chose to upgrade our old WPF application to .Net 5/6 and dropped the complete Electron.Net port. I felt sad for this but we could not promise anything on Electron.Net.
@danatcofo commented on GitHub (Dec 10, 2021):
@hemantsathe with such a wide distribution you might have been hit by an issue in .net around OS language default naming practices. We hit an issue with Italian language where it wouldn't start because it couldn't find the .net5 runtime. Rather than looking under the language specific location of
Programmi\....it was looking under the English language location ofProgram Files\.... In order to fix that I had to update our build script to pass in/PublishReadyToRun trueas a parameter. I describe the issue in #630@schaveyt commented on GitHub (Dec 27, 2021):
@hemantsathe et al. I had a very similar issue recently where my electron.net was working for everyone but 2 machines. It turned out...localhost was being sent to their enterprise proxy for some dumb reason. The fix was to simply was for the user to add the environment variable "NO_PROXY" and that localhost is in its value.
@mcyenikoylu commented on GitHub (Sep 23, 2022):
Hi everyone,
I created a new app by following the "Usage" instructions on the GitHub page.
When I start the application it shows that it is running without errors in the terminal. The app's icon appears in the menu bar. But the application window is not displayed.
I colonized the API Demos and the same happened. Please watch the Loom video recording.
Computer specs:
Software features:
Thanks,
@hemantsathe commented on GitHub (Oct 16, 2022):
That could very well be the issue. The customer environment doesn't have easy proxy setting for non devs.
@GregorBiswanger commented on GitHub (Mar 28, 2023):
🎉🚀 New Electron.NET version 23.6.1 released 🚀🎉
With native Electron 23 and .NET 6 support. Your problem should be fixed here. If you continue to have the problem, please let us know. Please note the correct updating of your API & CLI. Info in the README. Have fun!
@abuga-bd commented on GitHub (May 5, 2023):
Hi, I tried to run the project found here https://github.com/ElectronNET/Electron.NET (src/ElectronNET.WebApp) using electronize start. The app opens in the task bar and I can see a splash screen but it remains stuck there.
OS: macOS Ventura - Version 13.3.1 (22E261)
dotnet --info:
.NET SDK (reflecting any global.json):
Version: 6.0.406
Commit: 2988897946
Runtime Environment:
OS Name: Mac OS X
OS Version: 13.3
OS Platform: Darwin
RID: osx-arm64
Base Path: /usr/local/share/dotnet/sdk/6.0.406/
global.json file:
Not found
Host:
Version: 6.0.14
Architecture: arm64
Commit: 2a90daa2cc
.NET SDKs installed:
6.0.406 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.14 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.14 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
node --version
v18.14.1
electronize version
ElectronNET.CLI Version: 23.6.1.0
dotnet tool list -g
Package Id Version Commands
electronnet.cli 23.6.1 electronize
x 6.0.11 x
I have a colleague who runs the same configuration on Windows and for him it works, and another one who runs it on macOS (same as me) and his also works. I am the only one who can't use electronize on his machine.
Could somebody provide some guidance?
The command that I runned and its output:
electronize start
Start Electron Desktop Application...
Arguments:
dotnet publish -r osx-x64 -c "Debug" --output "/Users/abuga/Electron.NET/src/ElectronNET.WebApp/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.
ElectronNET.API -> /Users/abuga/Electron.NET/src/ElectronNET.API/bin/Debug/net6.0/ElectronNET.API.dll
/tmp/MSBuildTemproot/tmp8d562b9729744b348586e7da3e313089.exec.cmd: line 2: /Users/abuga/Electron.NET/src/ElectronNET.API/devCleanup.sh: Permission denied
ElectronNET.WebApp -> /Users/abuga/Electron.NET/src/ElectronNET.WebApp/bin/Debug/net6.0/osx-x64/ElectronNET.WebApp.dll
ElectronNET.WebApp -> /Users/abuga/Electron.NET/src/ElectronNET.WebApp/obj/Host/bin/
node_modules missing in: /Users/abuga/Electron.NET/src/ElectronNET.WebApp/obj/Host/node_modules
Start npm install...
npm install
up to date, audited 153 packages in 509ms
22 packages are looking for funding
run
npm fundfor detailsfound 0 vulnerabilities
ElectronHostHook handling started...
Start npm install for typescript & hosthooks...
npm install
added 118 packages, and audited 119 packages in 757ms
6 packages are looking for funding
run
npm fundfor details3 vulnerabilities (2 low, 1 high)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run
npm auditfor details.npx tsc -p ../../ElectronHostHook
../../ElectronHostHook/connector.ts(2,33): error TS2503: Cannot find namespace 'SocketIO'.
../../ElectronHostHook/excelCreator.ts(1,24): error TS2307: Cannot find module 'exceljs' or its corresponding type declarations.
../../ElectronHostHook/excelCreator.ts(2,37): error TS2307: Cannot find module 'exceljs' or its corresponding type declarations.
../../ElectronHostHook/index.ts(7,25): error TS2503: Cannot find namespace 'SocketIO'.
Invoke electron - in dir: /Users/abuga/Electron.NET/src/ElectronNET.WebApp/obj/Host/node_modules/.bin

./electron "../../main.js"
Electron Socket IO Port: 8000
Electron Socket started on port 8000 at 127.0.0.1
ASP.NET Core Port: 8001
---STUCK HERE
@abuga-bd commented on GitHub (May 6, 2023):
Hi, it seems the issue was me using .net 6 sdk for macos arm64 for the "electronize start" command published on osx-x64. I switched to .net 6 sdk macos x64 and now it's working fine.