mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-11-16 09:21:01 +00:00
Fix dev launches passing the script file instead of the app directory
Point the unpackaged dev launches at the .electron directory rather than main.js, so Electron reads package.json as the app manifest and resolves the app name and the default userData folder from productName at process startup, instead of falling back to the default app's "Electron" name. Covers the .NET-first branch in ElectronProcessActive and the Electron-first launches (launchSettings and docs).
This commit is contained in:
@@ -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"
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user