Upgrading to Windows 10 breaks MySQL workbench?

谁说我不能喝 提交于 2019-12-03 15:31:38

问题


I recently upgraded to the released version of Windows 10 using the automatic upgrade feature from Windows 8. In addition to some other stuff breaking, it seems that MySQL Workbench is now broken.

The program starts fine, but when you try to connect to a database, you are presented with a fatal error:

The type initializer for 'HtmlRenderer.Utils.FontsUtils' threw an exception.

This occurs even after a restart and seems to occur every time.


回答1:


The issue occurs due to the HTML rendered dll that is included in Workbench. Full details of the bug are here.

For a quick fix, thanks to Michael Gaillez and Frank Quintero, the offending code is in this repo: https://github.com/ArthurHub/HTML-Renderer

To fix it yourself, replace this code:

static FontsUtils()
    {
        _fontsMapping["monospace"] = "Courier New";
        _fontsMapping["Helvetica"] = "Arial";

        foreach (var family in FontFamily.Families)
        {
            _existingFontFamilies.Add(family.Name, family);
        }
    }

With this code:

static FontsUtils()
    {
        _fontsMapping["monospace"] = "Courier New";
        _fontsMapping["Helvetica"] = "Arial";

        foreach (var family in FontFamily.Families)
        {
            if (!_existingFontFamilies.ContainsKey(family.Name))
            {
                _existingFontFamilies.Add(family.Name, family);
            }
        }
    }

Or download this DLL instead: https://bugs.mysql.com/file.php?id=22868&bug_id=75673

You want to put this new DLL in your Workbench folder, which, for me, is C:\Program Files\MySQL\MySQL Workbench 6.3 CE\




回答2:


Just reinstall Workbench, that'll fix it.



来源:https://stackoverflow.com/questions/32020024/upgrading-to-windows-10-breaks-mysql-workbench

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!