SectionReport for net6.0 on Linux - System.Xml.XmlDocument issues

Posted by: marius.grande.andersen on 30 January 2022, 8:29 pm EST

    • Post Options:
    • Link

    Posted 30 January 2022, 8:29 pm EST

    Hi. I have ActiveReports 16 and need to run SectionReports on Linux.

    When I host on Windows, it works fine.

    When I host on Linux, I get issue:

    The type name 'XmlDocument' could not be found in the namespace 'System.Xml'. This type has been forwarded to assembly 'System.Private.Xml'...
    

    At some part in the code I type this, and it’s the first line that fails:

    System.Xml.XmlDocument doc = ((XMLDataSource)rpt.DataSource).Document;

    string myNode = doc.SelectSingleNode(@“//SeekInfo/Criterias”).InnerText.ToString();

    What am I supposed to do to fix this? Does it have to be rewritten away from System.Xml.XmlDocument? If so, how?

  • Posted 30 January 2022, 8:33 pm EST

    To add some more context the “rpt” is the ActiveReport type, and it’s recieved in the ActiveReport_ReportStart() method.

  • Posted 1 February 2022, 6:26 am EST

    Hi Marius,

    Please try adding the following line of code to your application before running the report:

    rpt.AddScriptReference(typeof(XmlDocument).Assembly.Location);
    

    Please let us know if the issue still persists.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels