public XmlFormatter() { Context = new StreamingContext(StreamingContextStates.All); Binder = new XmlFormatterBinder(); ErrorCallback = (error) => { throw new Exception(error); }; }