#3630·wpf

RichTextBox insert text application will crash

Author: LuoyingliangCreated Oct 12, 2020Updated Sep 29, 2026
LabelsBugPriority:0Wave1
  • .NET Core Version: netcoreapp 3.1
  • Windows version: Windows 10 CMGE
  • Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
  • Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc...)? No.
  • Security issues and bugs should be reported privately, learn more via our responsible disclosure guidelines.

Problem description: the problem occur when we set the caret on the BlockUIContainer and typing any character,that will raise FatalExecutionEngineError in framework 4.7.2 or raise ExecutionEngineException in netcore 3.1.

How to reproduce?

  1. create an wpf project,and add this xaml code to mainwindow.xaml
xaml
<RichTextBox>
            <FlowDocument>
                <BlockUIContainer>
                    <Image Source="D:\sample.jpg"/>
                </BlockUIContainer>
            </FlowDocument>
        </RichTextBox>
  1. use an image file to instead D:\sample.jpg
  2. run app
    4.click image and press Arrow-Right
    5.type any character