MarkupConverter
MarkupConverter copied to clipboard
overflow exception in method ReadLookAheadCharacter from the HtmlLexicalAnalyzer class
I have an WPF application in which i am using the classes (htmlLexicalAnalyzer.cs, HtmlToXAMLConverter, etc.) from the sample application HtmlToXAMLDemo (the main repo).
I have changed the namespace of that classes for mine only.
Then in my physical pc is working correctly (no errors nor exceptions).
Then I create an MSI and deploy my WPF application to a new clean and fresh pc (a virtual machine). After installation I execute it and I get the below exception:
System.OverflowException: Arithmetic operation resulted in an overflow. at myApp.Converters.HtmlConverter.HtmlLexicalAnalyzer.ReadLookAheadCharacter() at myApp.Converters.HtmlConverter.HtmlLexicalAnalyzer.GetNextCharacter() at myApp.Converters.HtmlConverter.HtmlLexicalAnalyzer.GetNextTagToken() at myApp.Converters.HtmlConverter.HtmlParser.ParseHtmlContent() at myApp.Converters.HtmlConverter.HtmlToXamlConverter.ConvertHtmlToXaml(String htmlString, Boolean asFlowDocument) at myApp.UI.HtmlRichTextBoxBehavior.OnValueChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
It looks like there is something wrong in ReadLookAheadCharacter that is causing this exception in some particular scenario like mine.
Please, could you have a look at it and fix it? Thanks in advance.