Skip to content

Commit 0d1e543

Browse files
committed
Fix formatting
1 parent b9eb0b5 commit 0d1e543

2 files changed

Lines changed: 64 additions & 13 deletions

File tree

docs/Core/Advanced-Migration-Topics.md

Lines changed: 62 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
11
# Advanced Migration Topics
22

3-
// 1. WebPort
4-
// specifying the WebPort in the manifest is no longer supported
5-
// from commit message:
6-
//- Removed the 'electronWebPort' handling
7-
// When ASP.Net is launched first, then the information which port it
8-
// should use would be coming too late; anyway, there's no need for
9-
// letting the port number round-trip all the way through the manifest
10-
// file, loaded by main.js and then sent to dotnet.
11-
//
3+
This guide covers advanced scenarios and edge cases that may require additional configuration when migrating to ElectronNET.Core.
124

13-
if the asp web port needs to be specified manually, this can be by setting it via MSBuild like this:
5+
## Custom ASP.NET Port Configuration
146

15-
<ItemGroup>
16-
<AssemblyMetadata Include="AspNetHttpPort" Value="4000" />
17-
</ItemGroup>
7+
### Port Configuration Changes
188

9+
**Previous Approach:**
10+
Specifying the WebPort in `electron.manifest.json` is no longer supported because the ASP.NET-first launch mode makes this timing-dependent.
11+
12+
**New Approach:**
13+
Configure custom ASP.NET ports through MSBuild metadata:
14+
15+
```xml
16+
<ItemGroup>
17+
<AssemblyMetadata Include="AspNetHttpPort" Value="4000" />
18+
<AssemblyMetadata Include="AspNetHttpsPort" Value="4001" />
19+
</ItemGroup>
20+
```
21+
22+
**Usage in Code:**
23+
```csharp
24+
// Access configured ports at runtime
25+
var port = int.Parse(Electron.App.GetEnvironmentVariable("AspNetHttpPort") ?? "5000");
26+
```
1927

2028
## Custom ElectronHostHook Configuration
2129

@@ -62,3 +70,44 @@ if the asp web port needs to be specified manually, this can be by setting it vi
6270
- **Updated Node.js Types** - Compatibility with Node.js 22.x APIs
6371
- **ESLint Integration** - Better code quality and consistency
6472
- **MSBuild Compilation** - Integrated with Visual Studio build process
73+
74+
## Troubleshooting Advanced Scenarios
75+
76+
### Multi-Project Solutions
77+
78+
When using ElectronNET.Core in multi-project solutions:
79+
80+
1. **Install ElectronNET.Core.Api** in class library projects
81+
2. **Install ElectronNET.Core** only in the startup project
82+
3. **Share configuration** through project references or shared files
83+
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+
```
108+
109+
## Next Steps
110+
111+
- **[Migration Guide](Migration-Guide.md)** - Complete migration process
112+
- **[What's New?](What's-New.md)** - Overview of all ElectronNET.Core features
113+
- **[Getting Started](../GettingStarted/ASP.Net.md)** - Development workflows

docs/Core/Migration-Guide.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ You can also manually edit `electron-builder.json`:
5757
"icon": "assets/app.ico"
5858
}
5959
}
60+
```
61+
6062
## 🎯 Testing Migration
6163

6264
After completing the migration steps:

0 commit comments

Comments
 (0)