Closed slahn closed 7 years ago
This is because constructors are not run when using DataContractSerializer.
You could implement initialization methods and use [OnDeserializing]
, or you could switch to Newtonsoft.Json.
I'm happy to supply a pull request for either of them. Which would you prefer?
I believe Newtonsoft.Json might be overkill for this. If you provide the pull request I will be more than happy to merge it. Otherwise I will work on it mid next week. Thanks for your help.
Replaced Newtonsoft.Json with JavaScriptSerializer
(from System.Web.Script.Serialization
) to prevent having to load the third party assembly during build.
I've had to add the following to our config file in order to avoid Null reference exceptions when merging: