-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Deserialize byte array which was serialized by the native BinaryFormatter of .NET framework 4.5.2 #13
Comments
Please note that the binary stream format of my serializer is not compatible with If you use .NET 8 now, you might have already noticed that as of today, making 1. If you still MUST use the original
|
Hello, |
Hi, it works for the above described concurrent dictionary. I have another concurrent dictionary with an enum as key (TypeB) and a object with two properties in it (TypeC with interface ITypeC), which is not working:
TypeC:
TypeB is a enum. I changed you code above to the following:
At the line with the foreach i get an array of key value pairs in the Best regards and thank you for your help 😄 |
Hmm... It's strange that in one case Can you confirm that if you execute that code in .NET Framework (using the surrogate selector that would not be necessary for the Framework but still helps debugging the inner steps), then Please also note that if you handle multiple types/scenarios in the |
This has not worked, so i decided to recreate the database. But this time i used your library to serialize data. Thank you for your help. |
I have the following Situation:
I had an old .NET Framework 4.5.2 application that in the past stored the following objects serialized by the native BinaryFormatter in a SQL database:
Now I have upgraded the application to ASP.NET 8 and when I now try to load and deserialize the data using the native BinaryFormatter, I get the following exception:
So I thought I'd use the KGySoft.CoreLibraries to deserialize the data, because it should be possible to deserialize types that are no longer marked as
[Serializable]
.But the problem now is that I always get
null
back from the methodBinarySerializer.DeserializeFromStream<T>(stream)
.How can I solve this? Because the DB is actually read-only for me, and it would be a big effort to fill the database again.
The text was updated successfully, but these errors were encountered: