-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interesting Bug...version 2.0.34 #16
Comments
Hello. There are differences here in what happens during serialization and deserialization. C# is designed to load libraries the first time you explicitly use any type from that library. As I understand it, when deserializing, BinaryFormatter requires that the required library has already been loaded. Therefore, to fix it, you just need to explicitly call any type from your library at the time of server initialization like: _ = new PipeMessage() |
I'm actively developing a SourceGenerator that generates client/server code based on a C# interface. I would be glad if you take a look at it (if you are still interested) and provide any feedback - https://github.com/HavenDV/H.Ipc |
Hmm...that didn't seem to fix the issue. Here is what I put on the server (see second line):
On the client I did the same. Unfortunately, the same error message pops up. |
Please try this: var formatter = new BinaryFormatter();
formatter.InternalFormatter.Binder = new CustomizedBinder();
_PipeServer = new PipeServer<PipeMessage>(PipeName, formatter: formatter); |
Hi @HavenDV Thanks to your pointers and your latest code changes, I was able to get it to work with the following:
and then the CustomizedBinder:
Fantastic support! How can I buy you a beer? |
Thanks. Not at the moment, I'm from Russia. Your star will be enough for me 😉 |
Using H.Pipes, H.Formatter & H.Formatters.BinaryFormatteer version 2.0.34 NuGets.
I'm writing a plugin for a WinForms 4.7.2 program (server) which is trying to talk to a .NET 6.0 WPF application (client). It uses a separate Pipes_Shared .NET Standard 2.0 class for the messages between the two applications:
The two ends of the pipe connect just fine. I get a message back from the server that goes through the PipeMessage to send a "You have connected!" message to the WPF client. No problems there. But I send some text back from the client to the server, the
trips with the very odd message:
How is that possible that the server found the assembly pipes_shared the first time around to generate the message to the client, but now it can't find it for deserialization?
Thanks,
The text was updated successfully, but these errors were encountered: