Application crashes on start #959

Open
opened 2026-01-29 16:52:55 +00:00 by claunia · 0 comments
Owner

Originally created by @boroneaionut on GitHub (Aug 1, 2024).

  • Version: 23.6.2

.NET 8, Node.js 20.13.0

  • Target: win

I am using Azure DevOps pipelines to build and deploy the application to a VM. When I start the application on the VM, it almost instantly crashes. I can see the CPU usage jumping to 100% and then the process stops. The same application built on my local machine and then copied to the VM works correctly. The pipeline is configured to use the exact configuration as my local machine (except for the Windows version).

The crash is likely related to electron because the application is configured to run DB migrations before creating the Electron window, which are successfully applied.

I figure the issue might be related to environment differences. Could it be an issue with building the application on Windows Server?
Any help is appreciated.

Thanks!

Here is the log from the Event Viewer:

Faulting application name: app.exe, version: 1.0.0.0, time stamp: 0x6402a76f
Faulting module name: app.exe, version: 1.0.0.0, time stamp: 0x6402a76f
Exception code: 0x80000003
Fault offset: 0x00000000018d4e14
Faulting process id: 0x1454

Program.cs

builder.Services.AddElectron();
builder.WebHost.UseElectron(args);

var app = builder.Build();

await app.Services.InitializeDatabaseAsync();

app.MapRazorComponents<UI.Components.App>()
	.AddInteractiveServerRenderMode();

await app.StartAsync();

var window = await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions
{
	Width = 1600,
	MinWidth = 800,
	Height = 1100,
	MinHeight = 500,
	HasShadow = false,
	Center = true,
	AutoHideMenuBar = true,
	Frame = false
});

window.OnClosed += Electron.App.Quit;

await Electron.IpcMain.On("minimize-window", (e) =>
{
	window.Minimize();
});

await Electron.IpcMain.On("toggle-fullscreen", (e) =>
{
	var isMaximized = window.IsMaximizedAsync().Result;
	if (isMaximized)
	{
		window.Unmaximize();
	}
	else
	{
		window.Maximize();
	}
});

await Electron.IpcMain.On("close-window", (e) =>
{
	window.Close();
});

app.WaitForShutdown();

Steps to Reproduce:

Originally created by @boroneaionut on GitHub (Aug 1, 2024). <!-- Please search existing issues to avoid creating duplicates. --> <!-- Which version of Electron.NET CLI and API are you using? --> <!-- Please always try to use latest version before report. --> * **Version**: 23.6.2 <!-- Which version of .NET Core and Node.js are you using (if applicable)? --> .NET 8, Node.js 20.13.0 <!-- What target are you building for? --> * **Target**: win <!-- Enter your issue details below this comment. --> I am using Azure DevOps pipelines to build and deploy the application to a VM. When I start the application on the VM, it almost instantly crashes. I can see the CPU usage jumping to 100% and then the process stops. The same application built on my local machine and then copied to the VM works correctly. The pipeline is configured to use the exact configuration as my local machine (except for the Windows version). The crash is likely related to electron because the application is configured to run DB migrations before creating the Electron window, which are successfully applied. I figure the issue might be related to environment differences. Could it be an issue with building the application on Windows Server? Any help is appreciated. Thanks! Here is the log from the Event Viewer: ``` Faulting application name: app.exe, version: 1.0.0.0, time stamp: 0x6402a76f Faulting module name: app.exe, version: 1.0.0.0, time stamp: 0x6402a76f Exception code: 0x80000003 Fault offset: 0x00000000018d4e14 Faulting process id: 0x1454 ``` Program.cs ``` builder.Services.AddElectron(); builder.WebHost.UseElectron(args); var app = builder.Build(); await app.Services.InitializeDatabaseAsync(); app.MapRazorComponents<UI.Components.App>() .AddInteractiveServerRenderMode(); await app.StartAsync(); var window = await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions { Width = 1600, MinWidth = 800, Height = 1100, MinHeight = 500, HasShadow = false, Center = true, AutoHideMenuBar = true, Frame = false }); window.OnClosed += Electron.App.Quit; await Electron.IpcMain.On("minimize-window", (e) => { window.Minimize(); }); await Electron.IpcMain.On("toggle-fullscreen", (e) => { var isMaximized = window.IsMaximizedAsync().Result; if (isMaximized) { window.Unmaximize(); } else { window.Maximize(); } }); await Electron.IpcMain.On("close-window", (e) => { window.Close(); }); app.WaitForShutdown(); ``` <!-- If you want, you can donate to increase issue priority (https://donorbox.org/electron-net) --> Steps to Reproduce: 1. 2.
claunia added the bug label 2026-01-29 16:52:55 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#959