Closed berk-csi closed 1 year ago
The binary formatter between versions of .NET and operating systems is not guaranteed to be compatible. The WinUI formatter is likely different in some way that cannot be resolved. I recommend abandoning the binary formatter.
I am trying to use ServiceWire (NamedPipe & BinaryFormatterSerializer) with a WinUI based desktop application targeting .NET 6. I can successfully start the service, but any calls to the proxy made from the WinUI app is failing in SyncInterface method:
Calls to the proxy work if I don't use BinaryFormatterSerializer, or if I change the application to use WinForms rather than WinUI as the UI framework.
Attached reproducer solution has the latest ServiceWire projects along with two clients: one WinUI based and the other WinForms based. They share the code referencing ServiceWire (based on the published named pipes example) via a shared C# project. When using the default serializer, both applications can use ServiceWire without any errors. When using BinaryFormatterSerializer, only the WinForms application works.
Any help with resolving this issue is deeply appreciated!
Berk
ServiceWire.WinUI.zip