Allow us to pass our own JsonSerializerSettings for IPC communication #587

Closed
opened 2026-01-29 16:43:30 +00:00 by claunia · 3 comments
Owner

Originally created by @lukasportal on GitHub (Nov 4, 2020).

This is a very easy task to accomplish, really (unless I'm missing something 😄)

Basically, here, 5e0ef7edb5/ElectronNET.API/IpcMain.cs (L182)
we have the JSON settings hardcoded and very basic.
I would like to have control on how we serialize our JSON in the IPC communication.

It would be good to expose that setting to the public and allow us to change it somewhere, maybe like Electron.IpcMain.JSONSerializerSettings or something similar

Or maybe when calling Electron.IpcMain.Send(), add an overload that accepts a JsonSerializerSettings and use that instead.

Originally created by @lukasportal on GitHub (Nov 4, 2020). This is a very easy task to accomplish, really (unless I'm missing something 😄) Basically, here, https://github.com/ElectronNET/Electron.NET/blob/5e0ef7edb5012a8713d02f657f828b3a687d95c0/ElectronNET.API/IpcMain.cs#L182 we have the JSON settings hardcoded and very basic. I would like to have control on how we serialize our JSON in the IPC communication. It would be good to expose that setting to the public and allow us to change it somewhere, maybe like `Electron.IpcMain.JSONSerializerSettings` or something similar Or maybe when calling `Electron.IpcMain.Send()`, add an overload that accepts a `JsonSerializerSettings` and use that instead.
claunia added the Feature label 2026-01-29 16:43:30 +00:00
Author
Owner

@danatcofo commented on GitHub (Jan 25, 2021):

@lukasportal

There are some underlying assumptions on the JSON serializer settings to keep everything talking together, what are you wanting to be different from the basic one being used right now and why? Knowing this would lead to a better solution than a wholesale ability to override the serializer and possibly break other portions of the app.

@danatcofo commented on GitHub (Jan 25, 2021): @lukasportal There are some underlying assumptions on the JSON serializer settings to keep everything talking together, what are you wanting to be different from the basic one being used right now and why? Knowing this would lead to a better solution than a wholesale ability to override the serializer and possibly break other portions of the app.
Author
Owner

@GregorBiswanger commented on GitHub (Jan 25, 2021):

I'm with @danatcofo! Debugging problems is not easily possible here either.

@GregorBiswanger commented on GitHub (Jan 25, 2021): I'm with @danatcofo! Debugging problems is not easily possible here either.
Author
Owner

@lukasportal commented on GitHub (Jan 25, 2021):

I actually'skipped IPC altogether due to the big unreliability of constantly losing state and events. I moved to SignalR and things are smooth now.
I see a new version was released recently, so maybe this was fixed, but now it's too late for me

@lukasportal commented on GitHub (Jan 25, 2021): I actually'skipped IPC altogether due to the big unreliability of constantly losing state and events. I moved to SignalR and things are smooth now. I see a new version was released recently, so maybe this was fixed, but now it's too late for me
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#587