-
Notifications
You must be signed in to change notification settings - Fork 18
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
Binary Serialization does not work #4
Comments
FYI: Adding the [Serializable] attribute and then adding the following constructor resolved this issue: |
@winkert can you check the class I have in the |
@claycephas I realized as I was working on my own application that the constructor I put up is not correct. DateTime.FromFileTime() does not turn ticks to an accurate DateTime (I was struggling to understand why when I deserialized I was getting dates in the 3000s). There is a DateTime constructor that takes ticks and that is how I managed to get the information stored in the SerializationInfo (as ticks) to reload as a Date. |
I am using this Date struct in a SortedDictionary and it is throwing a SerializationException. I see that this is using the ISerializable interface but does not have the serialization constructor. I added the [Serializable] attribute in order to get it to serialize but when it tries to deserialize I get the following exception:
The constructor to deserialize an object of type 'System.Date' was not found.
The text was updated successfully, but these errors were encountered: