Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Improved migration checks to honor custom output paths and to detect `ProjectGuid` in publish profiles (#946)
- Fixed single instance handling on macOS (#1040)
- Fixed slow socket bridge startup by binding to an explicit loopback address (#1103)
- Fixed local debugging launching the host `main.js` as a script file, which made Electron run its default app and resolve app name and userData to "Electron" instead of the app's `productName` (dev launch now points at the `.electron` app directory)
- Fixed socket bridge connection when a system proxy is configured (#1105)
- Fixed electron-builder using the host RID instead of the target RID (#1097)
- Fixed cross-compilation behavior on same platform (#1098) @epsnm
Expand Down
4 changes: 2 additions & 2 deletions docs/Using/Debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Debug the Electron process when you need to inspect native Electron APIs:
"Electron (unpackaged)": {
"commandName": "Executable",
"executablePath": "node",
"commandLineArgs": "node_modules/electron/cli.js main.js -unpackedelectron",
"commandLineArgs": "node_modules/electron/cli.js . -unpackedelectron",
"workingDirectory": "$(TargetDir).electron",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
Expand Down Expand Up @@ -99,7 +99,7 @@ Add the debugging profiles to `Properties/launchSettings.json`:
"Electron (unpackaged)": {
"commandName": "Executable",
"executablePath": "node",
"commandLineArgs": "node_modules/electron/cli.js main.js -unpackedelectron",
"commandLineArgs": "node_modules/electron/cli.js . -unpackedelectron",
"workingDirectory": "$(TargetDir).electron",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
Expand Down
6 changes: 4 additions & 2 deletions docs/Using/Startup-Methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ The framework supports **8 different launch scenarios** covering every combinati
#### **`-unpackedelectron`** - Electron-first debugging
```bash
# Launch Electron first, which then starts .NET
node node_modules/electron/cli.js main.js -unpackedelectron
# ('.' = the .electron dir: Electron then reads its package.json as the app manifest,
# so the app name and userData folder resolve correctly instead of defaulting to "Electron")
node node_modules/electron/cli.js . -unpackedelectron
```

#### **`-unpackeddotnet`** - .NET-first debugging
Expand Down Expand Up @@ -146,7 +148,7 @@ The image above illustrates how each combination of deployment type, application
"Electron (unpackaged)": {
"commandName": "Executable",
"executablePath": "node",
"commandLineArgs": "node_modules/electron/cli.js main.js -unpackedelectron"
"commandLineArgs": "node_modules/electron/cli.js . -unpackedelectron"
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ protected override async Task StartCore()
startCmd = Path.Combine(electrondir, "node_modules", "electron", "dist", "Electron.app", "Contents", "MacOS", "Electron");
}

args = $"main.js -unpackeddotnet --trace-warnings -electronforcedport={this.socketPort:D} " + this.extraArguments;
// Pass the .electron directory instead of the main.js script file: with a script
// file Electron falls back to its default app, whose manifest is named "Electron",
// so the default userData folder becomes %APPDATA%\Electron from process startup.
args = $". -unpackeddotnet --trace-warnings -electronforcedport={this.socketPort:D} " + this.extraArguments;
workingDir = electrondir;
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/ElectronNET.ConsoleApp/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"Electron (unpackaged)": {
"commandName": "Executable",
"executablePath": "node",
"commandLineArgs": "node_modules/electron/cli.js main.js -unpackedelectron",
"commandLineArgs": "node_modules/electron/cli.js . -unpackedelectron",
"workingDirectory": "$(TargetDir).electron",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
Expand Down
2 changes: 1 addition & 1 deletion src/ElectronNET.WebApp/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"Electron (unpackaged)": {
"commandName": "Executable",
"executablePath": "node",
"commandLineArgs": "node_modules/electron/cli.js main.js -unpackedelectron",
"commandLineArgs": "node_modules/electron/cli.js . -unpackedelectron",
"workingDirectory": "$(TargetDir).electron",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
Expand Down
Loading