microsoft / microsoft/WPF-Samples

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

Open
#467 1 comment 0 reactions 1 assignee View on GitHub

@anjaligupta-dev is already working on this.

Since Dec 14, 2023.

waiting-author-feedback
Dominant language
C#
Stars
5.7k
Forks
3.3k
Avg merge
12d 8h
Merged PRs (30d)
2

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.