question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Application UI does not start on some laptops. No log or error

See original GitHub issue

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

            try
            {
                _logger.LogInformation("Attempting to launch the window asynchronously!");
               // This async call does not launch or probably never returns.
                var createWindowTask = Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions
                {
                    Title = string.Empty,
                    WebPreferences = new WebPreferences
                    {
                        NodeIntegration = true,
                        DevTools = true,
                        AllowRunningInsecureContent = true,
                        EnableRemoteModule = true
                    }
                });
                var browserWindow = await createWindowTask;
                if(createWindowTask.IsCanceled) _logger.LogInformation("Window creation is cancelled");
                if(createWindowTask.IsCompleted) _logger.LogInformation($"Window creation task completed with status : {createWindowTask.Status}");
                if (createWindowTask.Exception != null)
                {
                    _logger.LogError($"Exception in creating App Window: {createWindowTask.Exception.Message}");
                    var innerExceptions = createWindowTask.Exception.InnerExceptions;
                    if (innerExceptions?.Count > 0)
                    {
                        foreach (var ex in innerExceptions)
                        {
                            _logger.LogError($"Inner Exception: {ex.Message}");
                        }
                    }
                    _logger.LogError($"No further Inner Exceptions");
                }
                _logger.LogInformation("Initializing App - Electron Bootstrap- Menu Bar init - Begin");

                browserWindow.SetMenuBarVisibility(false);

                _logger.LogInformation("Initializing App - Electron Bootstrap- Menu Bar init - End");


                _logger.LogInformation("Initializing App - Electron Bootstrap- clear cache - Begin");

                await browserWindow.WebContents.Session.ClearCacheAsync();

                _logger.LogInformation("Initializing App - Electron Bootstrap- clear cache - End");


                _logger.LogInformation("Initializing App - Electron Bootstrap- Init browser window show action - Begin");

                browserWindow.OnReadyToShow += () => browserWindow.Show();

                _logger.LogInformation("Initializing App - Electron Bootstrap- Init browser window show action - End");
            }
            catch (Exception ex)
            {
                _logger.LogCritical($"Error when starting the App. \n\tSource: {ex.Source}\n\tMessage : {ex.Message}\n\tInner Exception:{ex.InnerException?.Message}");
            }

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:23 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
schaveytcommented, 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.

image

1reaction
danatcofocommented, Dec 9, 2021

NET6 support added in #636

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows 10 Login UI Application Error - The exception ...
I was unable to perform any operation and after pressing some random key, it showed the below error: "Login UI Application Error Login...
Read more >
(1st Person Ever to Have This Bug/Error?) Strange ...
Strange Graphical Bug That Makes MS Store + Certain Apps Open but with UI Blank Except for Text but when I hover over...
Read more >
Log4J does not log anything
I've looked at the WebSphere console when the application starts up and there are no errors there that might indicate why Log4J isn't...
Read more >
GUI does not start
Alt+F2 keystroke which started the terminal session for me and I was able to login. sudo apt purge gdm gdm3 sudo apt install...
Read more >
Troubleshooting Windows Devices: Workspace ONE ...
This Windows Desktop troubleshooting guide provides general troubleshooting guidance, as well as solutions to specific problems for various Windows Desktop ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found