Skip to content

ASP.NET process is spawned with confusing working directory #72

@tboby

Description

@tboby

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.

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);

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions