mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
Allow us to pass our own JsonSerializerSettings for IPC communication #587
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.JSONSerializerSettingsor something similarOr maybe when calling
Electron.IpcMain.Send(), add an overload that accepts aJsonSerializerSettingsand use that instead.@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.
@GregorBiswanger commented on GitHub (Jan 25, 2021):
I'm with @danatcofo! Debugging problems is not easily possible here either.
@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