Skip to content

Commit 88766ad

Browse files
committed
Update docs after manual review
1 parent 341ebe2 commit 88766ad

16 files changed

+512
-707
lines changed

docs/Core/Advanced-Migration-Topics.md

Lines changed: 15 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,46 +6,47 @@ This guide covers advanced scenarios and edge cases that may require additional
66

77
### Port Configuration Changes
88

9-
**Previous Approach:**
9+
**Previous Approach:**
1010
Specifying the WebPort in `electron.manifest.json` is no longer supported because the ASP.NET-first launch mode makes this timing-dependent.
1111

12-
**New Approach:**
12+
**New Approach:**
1313
Configure custom ASP.NET ports through MSBuild metadata:
1414

1515
```xml
1616
<ItemGroup>
1717
<AssemblyMetadata Include="AspNetHttpPort" Value="4000" />
18-
<AssemblyMetadata Include="AspNetHttpsPort" Value="4001" />
1918
</ItemGroup>
2019
```
2120

22-
**Usage in Code:**
23-
```csharp
24-
// Access configured ports at runtime
25-
var port = int.Parse(Electron.App.GetEnvironmentVariable("AspNetHttpPort") ?? "5000");
26-
```
27-
2821
## Custom ElectronHostHook Configuration
2922

23+
> [!NOTE]
24+
> These changes are only required in case you are using a custom ElectronHostHook implementation!
25+
> If you have an ElectronHostHook folder in your project but you did not customize that code and aren't using its demo features (Excel and ZIP), you can also just remove that folder from your project.
26+
27+
3028
### TypeScript and Node.js Updates
3129

3230
**Update package.json:**
31+
32+
This shows the delevant changes only: All shown versions are the new required minimum versions.
33+
3334
```json
3435
{
3536
"devDependencies": {
36-
"eslint": "^9.37.0",
3737
"@types/node": "^22.18",
3838
"typescript": "^5.9.3"
3939
},
4040
"dependencies": {
41-
"archiver-utils": "^2.1.0",
4241
"socket.io": "^4.8.1",
43-
"exceljs": "^1.10.0"
4442
}
4543
}
4644
```
4745

48-
**Update Project File:**
46+
**Update Project File:**
47+
48+
The below modifications will allow you to use the latest TypeScript compiler in your ASP.Net project.
49+
4950
```xml
5051
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="5.9.3" />
5152

@@ -78,33 +79,9 @@ var port = int.Parse(Electron.App.GetEnvironmentVariable("AspNetHttpPort") ?? "5
7879
When using ElectronNET.Core in multi-project solutions:
7980

8081
1. **Install ElectronNET.Core.Api** in class library projects
81-
2. **Install ElectronNET.Core** only in the startup project
82+
2. **Install ElectronNET.Core and ElectronNET.Core.AspNet** only in the startup project
8283
3. **Share configuration** through project references or shared files
8384

84-
### Custom Build Processes
85-
86-
For advanced build customization:
87-
88-
```xml
89-
<PropertyGroup>
90-
<ElectronNETCoreOutputPath>custom\output\path</ElectronNETCoreOutputPath>
91-
<ElectronNETCoreNodeModulesPath>custom\node_modules</ElectronNETCoreNodeModulesPath>
92-
</PropertyGroup>
93-
```
94-
95-
### Environment-Specific Configuration
96-
97-
Handle different environments with conditional configuration:
98-
99-
```xml
100-
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
101-
<ElectronNETCoreEnvironment>Development</ElectronNETCoreEnvironment>
102-
</PropertyGroup>
103-
104-
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
105-
<ElectronNETCoreEnvironment>Production</ElectronNETCoreEnvironment>
106-
</PropertyGroup>
107-
```
10885

10986
## Next Steps
11087

docs/Core/Migration-Guide.md

Lines changed: 55 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ PM> Install-Package ElectronNET.Core
2525
PM> Install-Package ElectronNET.Core.AspNet # For ASP.NET projects
2626
```
2727

28-
> **Note**: The API package is automatically included as a dependency of `ElectronNET.Core`. See [Package Description](../Releases/Package-Description.md) for details about the package structure.
28+
> **Note**: The API package is automatically included as a dependency of `ElectronNET.Core`. See [Package Description](../RelInfo/Package-Description.md) for details about the package structure.
2929
3030

3131
### Step 2: Configure Project Settings
3232

33-
**Auto-generated Configuration:**
33+
**Auto-generated Configuration:**
3434
ElectronNET.Core automatically creates `electron-builder.json` during the first build or NuGet restore. No manual configuration is needed for basic setups.
3535

36-
**Migrate Existing Configuration:**
36+
**Migrate Existing Configuration:**
3737
If you have an existing `electron.manifest.json` file:
3838

3939
1. **Open the generated `electron-builder.json`** file in your project
@@ -47,14 +47,18 @@ You can also manually edit `electron-builder.json`:
4747

4848
```json
4949
{
50-
"productName": "My Electron App",
51-
"appId": "com.mycompany.myapp",
52-
"directories": {
53-
"output": "release"
50+
"linux": {
51+
"target": [
52+
"tar.xz"
53+
]
5454
},
5555
"win": {
56-
"target": "nsis",
57-
"icon": "assets/app.ico"
56+
"target": [
57+
{
58+
"target": "portable",
59+
"arch": "x64"
60+
}
61+
]
5862
}
5963
}
6064
```
@@ -71,28 +75,26 @@ After completing the migration steps:
7175
## 🚨 Common Migration Issues
7276

7377
### Build Errors
74-
- **Missing RuntimeIdentifier**: Ensure `<RuntimeIdentifier>win-x64</RuntimeIdentifier>` is set
7578
- **Node.js version**: Verify Node.js 22.x is installed and in PATH
7679
- **Package conflicts**: Clean NuGet cache if needed
7780

7881
### Runtime Errors
79-
- **Port conflicts**: Update URLs in startup code to match your configuration
8082
- **Missing electron-builder.json**: Trigger rebuild or manual NuGet restore
8183
- **Process termination**: Use .NET-first startup mode for better cleanup
8284

8385
## 🚀 Next Steps
8486

8587
- **[What's New?](What's-New.md)** - Complete overview of ElectronNET.Core features
8688
- **[Advanced Migration Topics](Advanced-Migration-Topics.md)** - Handle complex scenarios
87-
- **[Getting Started](GettingStarted/ASP.Net.md)** - Learn about new development workflows
89+
- **[Getting Started](../GettingStarted/ASP.Net.md)** - Learn about new development workflows
8890

8991
## 💡 Migration Benefits
9092

91-
**Simplified Configuration** - No more CLI tools or JSON files
92-
**Better Debugging** - Native Visual Studio experience with Hot Reload
93-
**Modern Architecture** - .NET-first process lifecycle
94-
**Cross-Platform Ready** - Build Linux apps from Windows
95-
**Future-Proof** - Flexible Electron version selection
93+
**Simplified Configuration** - No more CLI tools or JSON files
94+
**Better Debugging** - Native Visual Studio experience with Hot Reload
95+
**Modern Architecture** - .NET-first process lifecycle
96+
**Cross-Platform Ready** - Build Linux apps from Windows
97+
**Future-Proof** - Flexible Electron version selection
9698

9799
### Step 3: Update Startup Code
98100

@@ -104,81 +106,65 @@ After completing the migration steps:
104106
using ElectronNET.API;
105107
using ElectronNET.API.Entities;
106108

107-
var builder = WebApplication.CreateBuilder(args);
109+
public static void Main(string[] args)
110+
{
111+
var builder = WebApplication.CreateBuilder(args);
108112

109-
// Enable Electron.NET with callback
110-
builder.WebHost.UseElectron(args, async () =>
111-
{
112-
var browserWindow = await Electron.WindowManager.CreateWindowAsync(
113-
new BrowserWindowOptions { Show = false });
113+
builder.UseElectron(args, ElectronAppReady);
114+
115+
var app = builder.Build();
116+
app.Run();
117+
}
114118

115-
await browserWindow.WebContents.LoadURLAsync("https://localhost:7001");
116-
browserWindow.OnReadyToShow += () => browserWindow.Show();
117-
});
119+
public static async Task ElectronAppReady()
120+
{
121+
var browserWindow = await Electron.WindowManager.CreateWindowAsync(
122+
new BrowserWindowOptions { Show = false });
118123

119-
var app = builder.Build();
120-
app.Run();
124+
browserWindow.OnReadyToShow += () => browserWindow.Show();
125+
}
121126
```
122127

123128
#### Traditional ASP.NET Core (IWebHostBuilder)
124129

125-
```csharp
130+
```csharp
126131
using ElectronNET.API;
127132
using ElectronNET.API.Entities;
128133

129-
public static void Main(string[] args)
130-
{
131-
CreateWebHostBuilder(args).Build().Run();
132-
}
133-
134-
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
135-
WebHost.CreateDefaultBuilder(args)
136-
.UseElectron(args, ElectronAppReady)
137-
.UseStartup<Startup>();
138-
139-
// Electron callback
140-
async Task ElectronAppReady()
141-
{
142-
var browserWindow = await Electron.WindowManager.CreateWindowAsync(
143-
new BrowserWindowOptions { Show = false });
144-
145-
await browserWindow.WebContents.LoadURLAsync("https://localhost:5001");
146-
browserWindow.OnReadyToShow += () => browserWindow.Show();
147-
}
134+
public static void Main(string[] args)
135+
{
136+
WebHost.CreateDefaultBuilder(args)
137+
.UseElectron(args, ElectronAppReady)
138+
.UseStartup<Startup>()
139+
.Build()
140+
.Run();
141+
}
142+
143+
public static async Task ElectronAppReady()
144+
{
145+
var browserWindow = await Electron.WindowManager.CreateWindowAsync(
146+
new BrowserWindowOptions { Show = false });
147+
148+
browserWindow.OnReadyToShow += () => browserWindow.Show();
149+
}
148150
```
149151

150152

151153
### Step 4: Update Development Tools
152154

153-
**Node.js Upgrade:**
154-
ElectronNET.Core requires Node.js 22.x. Update your installation:
155-
156-
**Windows:**
157-
1. Download from [nodejs.org](https://nodejs.org)
158-
2. Run the installer
159-
3. Verify: `node --version` should show v22.x.x
160-
161-
**Linux:**
162-
```bash
163-
# Using Node Version Manager (recommended)
164-
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
165-
source ~/.bashrc
166-
nvm install 22
167-
nvm use 22
168-
169-
# Or using package manager
170-
sudo apt update
171-
sudo apt install nodejs=22.*
172-
```
155+
See [System Requirements](../GettingStarted/System-Requirements.md).
173156

174157
### Step 5: Update Debugging Setup
175158

176159
**Watch Feature Removal:**
160+
177161
The old 'watch' feature is no longer supported. Instead, use the new ASP.NET-first debugging with Hot Reload:
178162

179163
- **Old approach**: Manual process attachment and slow refresh
180164
- **New approach**: Native Visual Studio debugging with Hot Reload
181165
- **Benefits**: Faster development cycle, better debugging experience
182166

183167
**Update Launch Settings:**
184-
Replace old watch configurations with new debugging profiles. See [Debugging](GettingStarted/Debugging.md) for detailed setup instructions.
168+
169+
Replace old watch configurations with new debugging profiles. See [Debugging](../GettingStarted/Debugging.md) for detailed setup instructions.
170+

docs/Core/What's-New.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ The new package architecture reflects a clearer separation of concerns:
2020
- **ElectronNET.Core.Api** - Pure API definitions for Electron integration
2121
- **ElectronNET.Core.AspNet** - ASP.NET-specific runtime components
2222

23-
This modular approach allows projects to include only what they need while maintaining the flexibility to scale from simple console applications to complex web applications.
23+
This modular approach allows projects to include only what they need while maintaining the flexibility to scale from simple console applications to complex web applications.
24+
More about the avaílable nuget packages: [Package Description](../RelInfo/Package-Description.md).
2425

2526
## Beyond ASP.NET: Console Application Support
2627

27-
### A Fundamental Shift in Accessibility
28+
### A Shift in Accessibility
2829

29-
One of the most significant breakthroughs in ElectronNET.Core is the removal of the ASP.NET requirement. Developers can now build Electron applications using simple console applications, dramatically expanding the use cases and removing a major barrier to adoption.
30+
A major new opportunity in ElectronNET.Core is the removal of the ASP.NET requirement. Developers can now build Electron solutions using simple DotNet console applications, expanding the use cases and removing a major barrier to adoption for a number of use cases.
3031

3132
### Flexible Content Sources
3233

@@ -43,7 +44,7 @@ This capability transforms ElectronNET from a web-focused framework into a versa
4344

4445
### Debugging Reimagined
4546

46-
The debugging experience has been completely transformed. The new ASP.NET-first launch mode means developers can now debug their .NET code directly, with full access to familiar debugging tools and Hot Reload capabilities. No more attaching to processes or working around limited debugging scenariosthe development workflow now matches standard ASP.NET development patterns.
47+
The debugging experience has been completely transformed. The new DotNet-first launch mode means developers can now debug their .NET code directly, with full access to familiar debugging tools and Hot Reload capabilities. No more attaching to processes or working around limited debugging scenariosthe development workflow now matches standard .NET development patterns.
4748

4849
### Cross-Platform Development Without Compromises
4950

@@ -71,7 +72,8 @@ The underlying process architecture has been fundamentally redesigned. Instead o
7172
- Enhanced error handling and recovery
7273
- Cleaner separation between web and native concerns
7374

74-
This architecture supports eight different launch scenarios, covering every combination of packaged/unpackaged deployment, console/ASP.NET hosting, and dotnet-first/electron-first initialization.
75+
This architecture supports eight different launch scenarios, covering every combination of packaged/unpackaged deployment, console/ASP.NET hosting, and dotnet-first/electron-first initialization. The Electron-first launch method is still available or course.
76+
For more details, see: [Startup Methods](../GettingStarted/Startup-Methods.md).
7577

7678
### Unpackaged Development Mode
7779

@@ -103,7 +105,9 @@ The migration path is designed to be straightforward:
103105
1. Update package references to the new structure
104106
2. Remove the old manifest file
105107
3. Configure project properties through Visual Studio
106-
4. Adopt new debugging workflows at your own pace
108+
4. Adopt new debugging workflows at your own pace
109+
110+
Further reading: [Migration Guide](Migration-Guide.md).
107111

108112
## Future Horizons
109113

0 commit comments

Comments
 (0)