Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
a33d76a
Bump ws, engine.io and socket.io-adapter
dependabot[bot] May 25, 2026
d9f3da8
Merge pull request #1068 from ElectronNET/dependabot/npm_and_yarn/src…
FlorianRappl May 25, 2026
94df47e
Bump tmp and exceljs in /src/ElectronNET.WebApp/ElectronHostHook
dependabot[bot] May 28, 2026
ed9a24b
Bump ws, engine.io and socket.io-adapter in /src/ElectronNET.Host
dependabot[bot] May 28, 2026
e44927a
Bump ws, engine.io and socket.io-adapter
dependabot[bot] May 29, 2026
58b9ad0
Improved argument forwarding
FlorianRappl Jun 6, 2026
b5858a6
Added support for Electron 42+
FlorianRappl Jun 7, 2026
a18944d
Removed wrongly placed line
FlorianRappl Jun 7, 2026
644628c
Merge pull request #1069 from ElectronNET/dependabot/npm_and_yarn/src…
FlorianRappl Jun 7, 2026
295b250
Merge pull request #1070 from ElectronNET/dependabot/npm_and_yarn/src…
FlorianRappl Jun 7, 2026
1620c50
Merge pull request #1071 from ElectronNET/dependabot/npm_and_yarn/src…
FlorianRappl Jun 7, 2026
1ec84cf
Use path directly
FlorianRappl Jun 7, 2026
0e83af0
Merge branch 'develop' of https://github.com/ElectronNET/Electron.NET…
FlorianRappl Jun 7, 2026
066efa8
Add service for resolving on-app-ready callback
AeonSake Jun 19, 2026
8e90065
Replace static property with resolver service
AeonSake Jun 19, 2026
27a8c69
Add missing extension method overloads
AeonSake Jun 19, 2026
0566610
Remove unused property
AeonSake Jun 19, 2026
3a10e7e
Add missing null-check
AeonSake Jun 19, 2026
b094051
Merge pull request #1077 from AeonSake/1076-add-overloads-for-useelec…
FlorianRappl Jun 21, 2026
7739374
Updated version
FlorianRappl Jun 22, 2026
94ff3c1
Updated token usage
FlorianRappl Jun 22, 2026
9b045cb
Bump ws, engine.io and socket.io-adapter in /src/ElectronNET.Host
dependabot[bot] Jun 24, 2026
f92f07a
Bump js-yaml in /src/ElectronNET.WebApp/ElectronHostHook
dependabot[bot] Jun 24, 2026
392419e
Merge branch 'develop' into dependabot/npm_and_yarn/src/ElectronNET.H…
FlorianRappl Jun 24, 2026
d7d2521
Merge pull request #1078 from ElectronNET/dependabot/npm_and_yarn/src…
FlorianRappl Jun 24, 2026
10b1b68
Merge pull request #1079 from ElectronNET/dependabot/npm_and_yarn/src…
FlorianRappl Jun 24, 2026
8c2382a
Split packaging to avoid duplication in .asar archive
epsnm Jul 3, 2026
5bdf623
fix examples build and publish
epsnm Jul 3, 2026
e79b029
Fix scoped css naming issue
epsnm Jul 3, 2026
86e5d74
dump to latest version
epsnm Jul 3, 2026
7fc5c9b
Merge pull request #1080 from epsitec-sa/bug/#1058
FlorianRappl Jul 5, 2026
bdee008
use default sdk runtime identifier
epsnm Jul 6, 2026
5aebe80
change to less brittle solution
epsnm Jul 6, 2026
3b5f21c
Merge pull request #1081 from epsitec-sa/bug/default-runtime
FlorianRappl Jul 6, 2026
d4d4e9d
Bump js-yaml in /src/ElectronNET.WebApp/ElectronHostHook
dependabot[bot] Jul 8, 2026
5974cb9
Merge branch 'develop' into dependabot/npm_and_yarn/src/ElectronNET.W…
FlorianRappl Jul 9, 2026
b6e496b
Merge pull request #1082 from ElectronNET/dependabot/npm_and_yarn/src…
FlorianRappl Jul 9, 2026
5da5d1c
Bump js-yaml from 4.1.1 to 4.3.0 in /src/ElectronNET.Host
dependabot[bot] Jul 14, 2026
5ae5bf0
Merge pull request #1083 from ElectronNET/dependabot/npm_and_yarn/src…
FlorianRappl Jul 15, 2026
4e69bcf
Bump js-yaml in /src/ElectronNET.WebApp/ElectronHostHook
dependabot[bot] Jul 22, 2026
20af8a6
Bump brace-expansion from 1.1.12 to 1.1.16 in /src/ElectronNET.Host
dependabot[bot] Jul 22, 2026
cec178c
Merge pull request #1086 from ElectronNET/dependabot/npm_and_yarn/src…
FlorianRappl Jul 22, 2026
95089e1
Merge pull request #1085 from ElectronNET/dependabot/npm_and_yarn/src…
FlorianRappl Jul 22, 2026
3fecc0e
fix: Visual studio load issue
epsnm Jul 24, 2026
0b30534
chore(dx): visual studio load regression, let electron choose the req…
epsnm Jul 27, 2026
44e5c4e
chore(build): runtime identifier is not required anymore
epsnm Jul 27, 2026
1d24067
Bump builder-util-runtime and electron-updater in /src/ElectronNET.Host
dependabot[bot] Jul 28, 2026
b41c7e5
Bump flatted in /src/ElectronNET.WebApp/ElectronHostHook
dependabot[bot] Jul 28, 2026
9b701f5
Bump socket.io-parser from 4.2.5 to 4.2.7 in /src/ElectronNET.Host
dependabot[bot] Jul 28, 2026
1fff688
chore: consolidate MSBuild configuration barriers
rvuistin Jul 26, 2026
5eeab1b
fix(warning): remove warining CS4014
epsnm Jul 14, 2026
820d7bb
Merge pull request #1087 from epsitec-sa/bug/#1084
FlorianRappl Jul 28, 2026
3e8ebde
Merge pull request #1088 from ElectronNET/dependabot/npm_and_yarn/src…
FlorianRappl Jul 28, 2026
e121450
Merge pull request #1090 from ElectronNET/dependabot/npm_and_yarn/src…
FlorianRappl Jul 28, 2026
4b65ed2
Merge pull request #1089 from ElectronNET/dependabot/npm_and_yarn/src…
FlorianRappl Jul 28, 2026
d4402d1
chore(build): Apply same NoWarn regardless of current runtime, platfo…
epsnm Jul 29, 2026
74a734a
Merge pull request #1092 from epsitec-sa/bug/#1091
FlorianRappl Jul 29, 2026
6055635
Potential fix for pull request finding
FlorianRappl Aug 3, 2026
cfd8be3
Potential fix for pull request finding
FlorianRappl Aug 3, 2026
09249f7
Potential fix for pull request finding
FlorianRappl Aug 3, 2026
7370381
Potential fix for pull request finding
FlorianRappl Aug 3, 2026
525d618
Potential fix for pull request finding
FlorianRappl Aug 3, 2026
2f8f717
Potential fix for pull request finding
FlorianRappl Aug 3, 2026
7fa5ec5
Fixed #1050
FlorianRappl Aug 3, 2026
4e39f5f
Added support for MacOS modern app icon #1047
FlorianRappl Aug 3, 2026
f88f5f8
Added tests, improved icon implementation
FlorianRappl Aug 3, 2026
3a2c997
Ensure windows are not retained after being destroyed #1008
FlorianRappl Aug 3, 2026
16cbc5f
Improved platform agnostic for test
FlorianRappl Aug 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# 0.5.2

## ElectronNET.Core

- Fixed token param being appended to external URLs (#1075)
- Fixed startup mode discriminator in case of existing `wwwroot` (#1050)
- Fixed CA1416 on ASP.NET project (#1091) @epsnm
- Fixed loading issue in plain Visual Studio (#1084) @epsnm
- Fixed bloated ASAR file (#1080) @epsnm
- Improved selection of runtime identifier (#1081) @epsnm
- Added more variants for `UseElectron` (#1076) @AeonSake
- Added support for modern MacOS app icon (#1047)

# 0.5.1

## ElectronNET.Core
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!-- This file prevents unintended imports of unrelated MSBuild files -->
<!-- Uncomment to include parent Directory.Packages.props file -->
<!--<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Packages.props', '$(MSBuildThisFileDirectory)../'))" />-->

</Project>
2 changes: 1 addition & 1 deletion docs/GettingStarted/Console-App.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Add the Electron.NET configuration to your `.csproj` file:
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ElectronNET.Core" Version="0.5.0" />
<PackageReference Include="ElectronNET.Core" Version="0.5.2" />
</ItemGroup>
```

Expand Down
6 changes: 6 additions & 0 deletions docs/Using/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ Since electron builder still expects a `package.json` file to exist, ElectronNET
}
```

### App Icon Path

The `ElectronIcon` property supports classic icon files (such as `.ico` and `.icns`) and modern macOS `.icon` app icon packages.

For `.icon`, provide the folder path (for example `Assets/MyApp.icon`). During build/publish, Electron.NET copies the full directory into the Electron output so `electron-builder.json` can reference it (for example `"mac": { "icon": "MyApp.icon" }`).

### Node.js Integration

Electron.NET requires Node.js integration to be enabled for IPC to function. If you are not using the IPC functionality you can disable Node.js integration like so:
Expand Down
46 changes: 35 additions & 11 deletions src/ElectronNET.API/API/WindowManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public sealed class WindowManager

internal WindowManager()
{
EnsureBrowserWindowClosedSubscription();
}

internal static WindowManager Instance
Expand Down Expand Up @@ -106,17 +107,6 @@ public async Task<BrowserWindow> CreateWindowAsync(BrowserWindowOptions options,
tcs.SetResult(browserWindow);
});

BridgeConnector.Socket.Once<int[]>("BrowserWindowClosed", (ids) =>
{
for (int index = 0; index < _browserWindows.Count; index++)
{
if (!ids.Contains(_browserWindows[index].Id))
{
_browserWindows.RemoveAt(index);
}
}
});

if (loadUrl.Equals("http://localhost", StringComparison.OrdinalIgnoreCase) && ElectronNetRuntime.AspNetWebPort.HasValue)
{
loadUrl = $"{loadUrl}:{ElectronNetRuntime.AspNetWebPort}";
Expand Down Expand Up @@ -149,6 +139,40 @@ public async Task<BrowserWindow> CreateWindowAsync(BrowserWindowOptions options,
return await tcs.Task.ConfigureAwait(false);
}

private readonly object _browserWindowSubscriptionSync = new();
private bool _browserWindowClosedSubscribed;

private void EnsureBrowserWindowClosedSubscription()
{
if (_browserWindowClosedSubscribed)
{
return;
}

lock (_browserWindowSubscriptionSync)
{
if (_browserWindowClosedSubscribed)
{
return;
}

BridgeConnector.Socket.On<int[]>("BrowserWindowClosed", HandleBrowserWindowClosed);
_browserWindowClosedSubscribed = true;
}
}

private void HandleBrowserWindowClosed(int[] ids)
{
if (ids == null || ids.Length == 0)
{
_browserWindows.Clear();
return;
}

var existingIds = ids.ToHashSet();
_browserWindows.RemoveAll(window => !existingIds.Contains(window.Id));
}

private bool IsWindows10()
{
return RuntimeInformation.OSDescription.Contains("Windows 10");
Expand Down
2 changes: 0 additions & 2 deletions src/ElectronNET.API/ElectronNetRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ static ElectronNetRuntime()

internal static int? ElectronProcessId { get; set; }

internal static Func<Task> OnAppReadyCallback { get; set; }

internal static ISocketConnection GetSocket()
{
return RuntimeControllerCore?.Socket;
Expand Down
93 changes: 93 additions & 0 deletions src/ElectronNET.AspNet/API/WebApplicationBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,98 @@ public static WebApplicationBuilder UseElectron(this WebApplicationBuilder build

return builder;
}

/// <summary>
/// Adds Electron.NET support to the current ASP.NET Core application and registers an application-ready callback.
/// </summary>
/// <param name="builder">The <see cref="WebApplicationBuilder"/> to extend.</param>
/// <param name="args">The command-line arguments passed to the process, forwarded to Electron.</param>
/// <param name="onAppReadyCallback">
/// An asynchronous callback invoked when the Electron app is ready. Use this to create windows or perform initialization.
/// </param>
/// <returns>
/// The same <see cref="WebApplicationBuilder"/> instance to enable fluent configuration.
/// </returns>
/// <example>
/// <code language="csharp">
/// var builder = WebApplication.CreateBuilder(args)
/// .UseElectron(args, async (processArgs) =>
/// {
/// // Create the main browser window or perform other startup tasks.
/// });
///
/// var app = builder.Build();
/// app.MapRazorPages();
/// app.Run();
/// </code>
/// </example>
public static WebApplicationBuilder UseElectron(this WebApplicationBuilder builder, string[] args, Func<string[], Task> onAppReadyCallback)
{
builder.WebHost.UseElectron(args, onAppReadyCallback);

return builder;
}

/// <summary>
/// Adds Electron.NET support to the current ASP.NET Core application and registers an application-ready callback.
/// </summary>
/// <param name="builder">The <see cref="WebApplicationBuilder"/> to extend.</param>
/// <param name="args">The command-line arguments passed to the process, forwarded to Electron.</param>
/// <param name="onAppReadyCallback">
/// An asynchronous callback invoked when the Electron app is ready. Use this to create windows or perform initialization.
/// </param>
/// <returns>
/// The same <see cref="WebApplicationBuilder"/> instance to enable fluent configuration.
/// </returns>
/// <example>
/// <code language="csharp">
/// var builder = WebApplication.CreateBuilder(args)
/// .UseElectron(args, async (serviceProvider) =>
/// {
/// // Create the main browser window or perform other startup tasks.
/// });
///
/// var app = builder.Build();
/// app.MapRazorPages();
/// app.Run();
/// </code>
/// </example>
public static WebApplicationBuilder UseElectron(this WebApplicationBuilder builder, string[] args, Func<IServiceProvider, Task> onAppReadyCallback)
{
builder.WebHost.UseElectron(args, onAppReadyCallback);

return builder;
}

/// <summary>
/// Adds Electron.NET support to the current ASP.NET Core application and registers an application-ready callback.
/// </summary>
/// <param name="builder">The <see cref="WebApplicationBuilder"/> to extend.</param>
/// <param name="args">The command-line arguments passed to the process, forwarded to Electron.</param>
/// <param name="onAppReadyCallback">
/// An asynchronous callback invoked when the Electron app is ready. Use this to create windows or perform initialization.
/// </param>
/// <returns>
/// The same <see cref="WebApplicationBuilder"/> instance to enable fluent configuration.
/// </returns>
/// <example>
/// <code language="csharp">
/// var builder = WebApplication.CreateBuilder(args)
/// .UseElectron(args, async (serviceProvider, processArgs) =>
/// {
/// // Create the main browser window or perform other startup tasks.
/// });
///
/// var app = builder.Build();
/// app.MapRazorPages();
/// app.Run();
/// </code>
/// </example>
public static WebApplicationBuilder UseElectron(this WebApplicationBuilder builder, string[] args, Func<IServiceProvider, string[], Task> onAppReadyCallback)
{
builder.WebHost.UseElectron(args, onAppReadyCallback);

return builder;
}
}
}
Loading
Loading