Skip to content

Cannot get a ipc connection to run with aspnetcore 2.1 & angular 6 #210

Open
@ffetech

Description

@ffetech

Hello Gregor, Hello Robert, Hello all,

Thank you for this library!

I have a AspNetCore 2.1 Angular 6 App with ElectronApi 0.11. "electronize start" works fine and the app starts fine but I cannot get a ipc connection to run.

I have an Angular service with the following parts of code to establish a ipc connection. Its executing immediately after angular app start,

import { IpcRenderer } from 'electron';
...
if (process.versions.electron && (<any>window).require)
this.ipc = (<any>window).require("electron").ipcRenderer;
...
this.ipc.send("connect", "x");

This is my code on C# side

var browserWindow = await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions { Show = false });
browserWindow.OnReadyToShow += () =>
{
Electron.IpcMain.On("connect", args => Connect());
browserWindow.Show();
};

if I make a sendSync on angular side, the app freezes. Do you have some idea what i did wrong.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions