Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overflow exception in ReadLookAheadCharacter in WPF-Samples-main\WPF-Samples\Sample Applications\HtmlToXamlDemo #467

Open
Kiraski2023 opened this issue Feb 6, 2023 · 1 comment
Assignees
Labels
waiting-author-feedback To request more information from author.

Comments

@Kiraski2023
Copy link

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.

@anjali-wpf
Copy link
Member

@Kiraski2023 For me it is working fine, could you please give it another try and still if it doesn't work then share the sample HTML which you are trying to convert here.

@anjali-wpf anjali-wpf added the waiting-author-feedback To request more information from author. label Dec 14, 2023
@anjali-wpf anjali-wpf self-assigned this Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-author-feedback To request more information from author.
Projects
None yet
Development

No branches or pull requests

2 participants