acdvorak / named-pipe-wrapper

Wrapper library for Windows Named Pipes in C# / .NET 4.0 / VS 2010
MIT License
233 stars 178 forks source link

Occasionally getting Error: Object Graph cannot be null #33

Open hareeshmu opened 3 years ago

hareeshmu commented 3 years ago

Seeing this error occasionally. Any fix can be applied?

Object Graph cannot be null. Parameter name: graph mscorlib at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck) at NamedPipeWrapper.IO.PipeStreamWriter1.Serialize(T obj) in C:\BitBucket\named-pipe-wrapper\NamedPipeWrapper\IO\PipeStreamWriter.cs:line 42 at NamedPipeWrapper.NamedPipeConnection2.WritePipe() in C:\BitBucket\named-pipe-wrapper\NamedPipeWrapper\NamedPipeConnection.cs:line 167 at NamedPipeWrapper.Threading.Worker.DoWorkImpl(Object oAction) in C:\BitBucket\named-pipe-wrapper\NamedPipeWrapper\Threading\Worker.cs:line 46

fernandoEhp commented 2 years ago

Same issue here

metscore commented 5 months ago

Unfortunately I also experience this problem.

metscore commented 5 months ago

A comment on this one:

I have a test program that I can run a few hundred times before the error appears.

However, if I replaced the NuGet package, by downloading the source code (and upgraded the project to .net 4.8), and recompiled, I can run the same test program 15000 times without seeing the issue. I'm not 100% sure why (I did not make any code changes) but the problem does not appear anymore.