Skip to content

Submit of report with CustomInfo fails #69

@Eiszapfen

Description

@Eiszapfen

Hi!

When creating a bug report with CustomInfo object set, NBug throws an exception when trying to submit this report. This problem was mentioned earlier here on StackOverflow.

In Report.cs the report class gets serialized in the ToString Methodwith this code:
var serializer = this.CustomInfo != null
? new XmlSerializer(typeof(Report), new[] { this.CustomInfo.GetType() })
: new XmlSerializer(typeof(Report));
so if setting CustomInfo != null the XmlSerializer constructor with the "extraTypes" parameter gets called. See MSDN.

After restarting the application, NBug tries to submit the bug report, this leads to Dispatcher.cs method GetDataFromZip(Stream stream) the deserialization of the report file happens always with the following call: var deserializer = new XmlSerializer(typeof(Report));

Unfortunately this leads to a wrongly deserialized Xml so the CustomInfo member of the Report class gets deserialized to a XmlNode[] which in turn cannot be correctly serialized later when submitting the bugreport.

Kind regards,
Andy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions