-
-
Notifications
You must be signed in to change notification settings - Fork 746
Closed
Description
When Electron.NET starts the asp.net application process it doesn't set a cwd. This means the cwd of the running process is used. Confusingly this is the location of electron.cmd, which is app\node_modules\.bin\.
Would it not make more sense for the asp.net application to start with its own directory as the cwd? This means calls such as File.ReadAllLines("./appsettings.json") behave as expected.
Currently that would read app\node_modules\.bin\appsettings.json not app\bin\appsettings.json.
Electron.NET/ElectronNET.Host/main.js
Lines 51 to 52 in 200f511
| const binFilePath = path.join(__dirname, 'bin', binaryFile); | |
| apiProcess = process(binFilePath, parameters); |
I think the change would be something like:
var options = { cwd: path.join(__dirname,'bin') }
apiProcess = process(binFilePath, parameters, options);