System.NullReferenceException at C1.Win.Xhtml.XmlValidator.CorrectCharset

Posted by: mgelasakis on 14 January 2025, 12:20 pm EST

  • Posted 14 January 2025, 12:20 pm EST

    Hello and Happy New Year.

    In a new installation of our application on a virtual machine windows server 2022 we get the following error. This only happens on one specific installation while on dozens of others on different clients it works without a problem. I believe it is caused by some setting in the windows system but I can’t figure out exactly what the problem is.

    [code]Error’s Analysis


    General Info:

    Σύστημα: DefaultDomain

    Ημερομηνία: 14/01/2025 5:59:58 μμ

    Ταυτότητα Windows: BO-SRV-VM\pho(#gTFTaYYC4K7h

    Χρήστης Συστήματος: nsDesigner

    1. Error’s Information

    Τύπος λάθους: System.NullReferenceException

    Message: Object reference not set to an instance of an object.

    Data: System.Collections.ListDictionaryInternal

    TargetSite: Boolean CorrectCharset(System.Xml.XmlDocument, Boolean, System.Text.Encoding ByRef)

    HelpLink: NULL

    Source: C1.Win.C1Editor.4

    HResult: -2147467261

    StackTrace:

    at C1.Win.Xhtml.XmlValidator.CorrectCharset(XmlDocument xmlDoc, Boolean convertToUTF8, Encoding& encoding)

    at C1.Win.Xhtml.XmlValidator.a(XmlDocument A_0, ConvertExtraWhitespacesMode A_1)

    at C1.Win.Xhtml.XmlValidator.LoadXmlDocument(XmlDocument xmlDoc, String xml, Boolean autofix, Boolean useXhtmlDtd, ConvertExtraWhitespacesMode convertExtraWhitespacesMode, Boolean strict)

    at C1.Win.C1Editor.Internal.EditorXmlDocument.Load(String xml, Boolean autoFix, Boolean convertToUTF8)

    at C1.Win.C1Editor.C1Editor.LoadDocument(String xml, Uri uri, Boolean autoFix, DocumentFormat format)

    at C1.Win.C1Editor.C1Editor.InitDocument()

    at C1.Win.C1Editor.C1Editor…ctor()

    at nsHTMLEditor.nsHTMLEditor.InitializeComponent()

    at nsHTMLEditor.nsHTMLEditor…ctor()

    at nsBrlCRM.frmHtmlEditor.InitializeComponent()

    at nsBrlCRM.frmHtmlEditor…ctor(String p_HtmlContent)

    at nsUIPCRM_GoldAir.Web_Information_App.m_System_FieldControlButtonClick(IField field, Boolean& continue)[/code]

    Could you please give me some help on what could be causing this?

    The version of Component One is 4.0.20202.438 if that helps.

    Thanks in advance.

    Best regards

    Manos

  • Posted 15 January 2025, 5:03 am EST - Updated 15 January 2025, 5:08 am EST

    Hello Manos,

    Happy New Year to you as well!!

    We tested the behavior with the mentioned version but could not replicate it with the following machine:

    Sample we used to verify: Editor_Sample.zip

    Could you please let us know if we are missing something here? Please update the attached sample or attach a stripped-down version of your project for further investigation.

    Furthermore, please use the latest version of the C1Editor (.NET Framework 4.8 2024v2) as the version you are using is out-of-support from our end. Currently, .NET FW 4.5.6, .NET FW 4.8, and .NET 6+ frameworks are supported.

    Also, if the behavior is confirmed to be a bug in the latest version as well, a fix will be available in the new releases only.

    Regards,

    Uttkarsh.

  • Posted 15 January 2025, 6:40 am EST - Updated 15 January 2025, 7:52 am EST

    Hello Uttkarsh

    I am running your example on the windows server where I have the problem and your example does not run either. I am attaching a screenshot of the error from the windows logs from your example.



    It runs without any error on different PCs. I can’t figure out what could be wrong with the specific PC that’s crashing.

    Regarding the upgrade of the version of component One, we should first see if the newest version is included in the license we have already purchased, otherwise we will have to purchase a new license.

    I believe that this particular error is not related to the specific version of component one but to some Windows server configuration on this particular PC because for many years now the same code has continued to run without problems in many installations at our different customers.

    However, could you send me the same example in the latest version so I can check if it runs on this particular machine before I proceed with any upgrade?

    What could be missing from Windows that affects the specific function that crashes?

    Thanks in advance.

    Manos

  • Posted 16 January 2025, 1:51 am EST

    Hello Manos,

    Thank you for testing our sample and confirming the behavior.

    I believe that this particular error is not related to the specific version of component one but to some Windows server configuration on this particular PC

    We understand your concerns; however, we need to rule out the possibility of the behavior being a bug in the older version and ensure that it replicates with the latest version as well to escalate for further investigation.

    Regarding the behavior specific to your machine configuration, we have tried different scenarios, like changing the System Locale to “Greek”, using mentioned Windows Server version, etc. but could not replicate the behavior

    Please test the behavior with the attached latest sample and let us know your observations. (see Editor_Sample_Latest.zip)

    Regards,

    Uttkarsh.

  • Posted 16 January 2025, 11:28 am EST - Updated 17 January 2025, 4:55 am EST

    Hello Uttkarsh.

    Thank you again.

    I am waiting for your response.

    Best regards.

    Manos

  • Posted 17 January 2025, 4:22 am EST

    Hello Manos,

    We have escalated the behavior to the development team for further insights. Rest assured, we’ll get back to you once we have more information. [Internal Tracking ID: C1WIN-33553]

    Regards,

    Uttkarsh.

  • Posted 17 January 2025, 4:57 am EST

    Hello Uttkarsh.

    Thank you again.

    I am waiting for your response.

    Best regards.

    Manos

  • Posted 21 January 2025, 8:50 am EST

    Hello Manos,

    Could you please share the screenshot again that you shared in https://developer.mescius.com/forums/c1-studio/system-nullreferenceexception-at-c1-win-xhtml-xmlvalidator-correctcharset#78735 response as it is hard to analyze screenshot?

    Please zip the original screenshot.

    Also, please let us know if you are able to replicate the behavior with an empty HTML file.

    Thank you for bearing with us.

    Regards,

    Uttkarsh.

  • Posted 21 January 2025, 11:09 am EST

    Hello

    I send you both screenshots with old sample and with the new too.

    Screenshots.zip

    Best regards

    Manos

  • Posted 22 January 2025, 12:35 am EST

    Hello Manos,

    Thank you for sharing the screenshots.

    We’ll get back to you once we have more information.

    Regards,

    Uttkarsh.

  • Posted 28 January 2025, 12:57 pm EST

    Hello Manos,

    Could you please test the behavior with an empty HTML file and let us know if it replicates? Please try running the attached sample and let us know the results. (see Editor_Sample_EmptyHtml.zip)

    Regards,

    Uttkarsh.

  • Posted 31 January 2025, 10:42 am EST

    Hello Uttkarsh

    First of all thank you for your response.

    Due to I don’t have the latest license I can’t build the Editor_Sample_EmptyHtml that you send me.

    Could you please build it and send me the executable again?

    Thank you in advance.

    Manos

  • Posted 3 February 2025, 5:39 am EST

    Hello Manos,

    Please refer to the bin folder in the following sample: Editor_Sample_exe.zip

    Regards,

    Uttkarsh.

  • Posted 5 February 2025, 7:24 am EST

    Hello Uttkarsh.

    Unfortunately it still crashes. I’m sending you the screenshots with the errors from the last example you sent me.

    LatestSampler_ScreenShots.zip

    Thank you in advance.

    Manos

  • Posted 6 February 2025, 5:53 am EST

    Hello Manos,

    Thank you for sharing the screenshots. The developers are investigating the behavior and will be adding a check for NullReferenceException in Editor to handle the error. [Bug Tracking ID: C1WIN-33621]

    Regards,

    Uttkarsh.

Need extra support?

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

Learn More

Forum Channels