| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Migrating from previous versions of Electron.NET to ElectronNET.Core is straightforward but requires several important changes. This guide walks you through the process step by step.
Before starting the migration:
Uninstall old packages:
dotnet remove package ElectronNET.APIInstall new packages:
dotnet add package ElectronNET.Core
dotnet add package ElectronNET.Core.AspNet # For ASP.NET projectsNote: The API package is automatically included as a dependency of ElectronNET.Core. See Package Description for details about the package structure.
Auto-generated Configuration:
ElectronNET.Core automatically creates electron-builder.json in the Properties folder of your project during the first build or NuGet restore. No manual configuration is needed for basic setups.
Migrate Existing Configuration:
If you have an existing electron.manifest.json file:
Alternative: Manual Configuration You can also manually edit electron-builder.json:
{
"linux": {
"target": [
"tar.xz"
]
},
"win": {
"target": [
{
"target": "portable",
"arch": "x64"
}
]
}
}Modify Launch Settings: ElectronNET.Core no longer needs a separate CLI tool (electronize.exe) for launching. You should update your launch settings to use either the ASP.NET-first or Electron-first approach. See Debugging for details.
After completing the migration steps:
โ
Simplified Configuration - No more CLI tools or JSON files
โ
Better Debugging - Native Visual Studio experience with Hot Reload
โ
Modern Architecture - .NET-first process lifecycle
โ
Cross-Platform Ready - Build Linux apps from Windows
โ
Future-Proof - Flexible Electron version selection
Update UseElectron() calls to include the new callback parameter. This callback executes at the right moment to initialize your Electron UI.
using ElectronNET.API;
using ElectronNET.API.Entities;
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
builder.UseElectron(args, ElectronAppReady);
var app = builder.Build();
app.Run();
}
public static async Task ElectronAppReady()
{
var browserWindow = await Electron.WindowManager.CreateWindowAsync(
new BrowserWindowOptions { Show = false });
browserWindow.OnReadyToShow += () => browserWindow.Show();
}using ElectronNET.API;
using ElectronNET.API.Entities;
public static void Main(string[] args)
{
WebHost.CreateDefaultBuilder(args)
.UseElectron(args, ElectronAppReady)
.UseStartup<Startup>()
.Build()
.Run();
}
public static async Task ElectronAppReady()
{
var browserWindow = await Electron.WindowManager.CreateWindowAsync(
new BrowserWindowOptions { Show = false });
browserWindow.OnReadyToShow += () => browserWindow.Show();
}See System Requirements.
Watch Feature Removal:
The old 'watch' feature is no longer supported. Instead, use the new ASP.NET-first debugging with Hot Reload:
Update Launch Settings:
Replace old watch configurations with new debugging profiles. See Debugging for detailed setup instructions.
Want to contribute to this documentation? Please fork and create a PR! The Wiki is autogenerated from the /docs content in the repository.
| Back | FazBrowse Home | New Git URL |