RichTextBox.RTF设置程序抛出System.ArgumentException.文件格式在Windows版本1803中无效 [英] RichTextBox.RTF setter throwing System.ArgumentException. File format is not valid in Windows version 1803

查看:258
本文介绍了RichTextBox.RTF设置程序抛出System.ArgumentException.文件格式在Windows版本1803中无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

模拟以下情况以重现崩溃:

The following scenario is simulated to reproduce the crash:

  1. 启用 Beta:Unicode UTF-8以支持全球语言( 启用开始=>区域和语言设置=>相关设置-> 附加日期,时间和时间区域设置=>区域->更改日期, 时间或数字格式=>选择管理"选项卡=>单击 更改系统区域设置.
  2. 检查Beta:针对全球语言支持的Unicode UTF-8复选框
  3. 重新启动系统
  4. 在Windows窗体中,Application =>添加一个窗体,RichTextBox,Button和 标签OnButtonClick =>在行下方添加

  1. Enable Beta: unicode UTF-8 for world wide language support (To enable Start=> Region & Language settings => Related settings -> Additional date, time & regional settings => Region -> Change date, time or number formats => select Administrative tab => Click on Change System Locale.
  2. Check Beta: unicode UTF-8 for world wide language support checkbox
  3. Restart the system
  4. In Windows forms Application => Add a form, RichTextBox, Button and a label OnButtonClick => add below lines

richTextBox1.SelectAll();
richTextBox1.Rtf = richTextBox1.SelectedRtf; //Leads Crash System.ArgumentException: File format is not valid.
label1.Text = "RichTextBox1.Rtf = " + richTextBox1.Rtf;

  • 如果我们取消选中 Beta:全球语言的Unicode UTF-8 支持,然后重新启动系统就没有问题.

  • If we UnCheck Beta: unicode UTF-8 for world wide language support, and restart the system there was no issue.

    在Windows版本1803中观察到该问题

    Issue is observed with windows version 1803

    对此用例的任何帮助都将受到赞赏

    Any help on this use case is appreciated

    推荐答案

    这也是Microsoft内部版本1803和1809的问题. 解决方法可以在这里找到.

    It is an issue from microsoft build 1803 and 1809 as well. Work around solution can be found here.

    查看全文

  • 登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆