Ipc is not working with a Blazor Server project #551

Closed
opened 2026-01-29 16:42:46 +00:00 by claunia · 5 comments
Owner

Originally created by @aksoftware98 on GitHub (Aug 15, 2020).

Originally assigned to: @GregorBiswanger on GitHub.

  • Version:

Currently using the latest version of Electron.NET with Blazor Server & .NET Core 3.1
And building the project for Windows

I have multiple razor pages but I cannot have the communicate works between them via Ipc

Steps to Reproduce:

  1. Created a razor page and with button and having a handler so when I click the button I send the following message like that
    var window = Elelctron.WindowManager.BrowserWindows.FirstOrDefault();
    Electron.IpcMain.Send(window, "message", "Hello");

  2. In another razor page I'm calling the on Method to listen to the 'message' channel and respond by showing an alert
    But when I click the button nothing is happening

Thanks

Originally created by @aksoftware98 on GitHub (Aug 15, 2020). Originally assigned to: @GregorBiswanger on GitHub. <!-- Which version of Electron.NET CLI and API are you using? --> <!-- Please always try to use latest version before report. --> * **Version**: Currently using the latest version of Electron.NET with Blazor Server & .NET Core 3.1 And building the project for Windows <!-- Enter your issue details below this comment. --> I have multiple razor pages but I cannot have the communicate works between them via Ipc Steps to Reproduce: 1. Created a razor page and with button and having a handler so when I click the button I send the following message like that `var window = Elelctron.WindowManager.BrowserWindows.FirstOrDefault();` `Electron.IpcMain.Send(window, "message", "Hello");` 2. In another razor page I'm calling the on Method to listen to the 'message' channel and respond by showing an alert But when I click the button nothing is happening Thanks
claunia added the help wantedbug labels 2026-01-29 16:42:46 +00:00
Author
Owner

@Xarkam commented on GitHub (Sep 2, 2020):

I understand better why my code is not working:

 Electron.IpcMain.On("show-app-menu-btn", (args) =>
      {
          var mainWindow = Electron.WindowManager.BrowserWindows.FirstOrDefault();
          Electron.Menu.ContextMenuPopup(mainWindow);
      });

Inside my blazor page.

@Xarkam commented on GitHub (Sep 2, 2020): I understand better why my code is not working: ``` Electron.IpcMain.On("show-app-menu-btn", (args) => { var mainWindow = Electron.WindowManager.BrowserWindows.FirstOrDefault(); Electron.Menu.ContextMenuPopup(mainWindow); }); ``` Inside my blazor page.
Author
Owner

@GregorBiswanger commented on GitHub (Oct 25, 2020):

With Blazor server-side, IPC communication should not be necessary.
On the server side, client + server merge.

Could i help?

@GregorBiswanger commented on GitHub (Oct 25, 2020): With Blazor server-side, IPC communication should not be necessary. On the server side, client + server merge. Could i help?
Author
Owner

@Gaulomatic commented on GitHub (Oct 25, 2020):

@GregorBiswanger That's correct, but the buggy IPC leads to the app not being able to close itself gracefully.

@Gaulomatic commented on GitHub (Oct 25, 2020): @GregorBiswanger That's correct, but the buggy IPC leads to the app not being able to close itself gracefully.
Author
Owner

@GregorBiswanger commented on GitHub (Oct 25, 2020):

i am currently working on improving communication.

@GregorBiswanger commented on GitHub (Oct 25, 2020): i am currently working on improving communication.
Author
Owner

@Gaulomatic commented on GitHub (Oct 25, 2020):

That's great news, thank you.

@Gaulomatic commented on GitHub (Oct 25, 2020): That's great news, thank you.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#551