Skip to content

System.Runtime.Serialization.SerializationException #1

@macpock

Description

@macpock

I installed your app from scratch, tried to add different sensors. Everytime I try to create a new sensor (no matter which one) it will fail : DateTime values that are greater than DateTime.MaxValue or smaller than DateTime.MinValue when converted to UTC cannot be serialized to JSON.

see attached picture

public static string Serialize(T entity)
{
var stream1 = new MemoryStream();
var ser = new DataContractJsonSerializer(typeof(T),new DataContractJsonSerializerSettings
{
UseSimpleDictionaryFormat = true
});
ser.WriteObject(stream1, entity);
stream1.Position = 0;
using (var sr = new StreamReader(stream1))
{
return sr.ReadToEnd();
}
}
2021-02-12 12_37_41-MonitoR (Debugging) - Microsoft Visual Studio

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions