当我尝试对其执行任何操作时,Visual Studio崩溃 [英] Visual Studio Crashes when i try to do anything with it

查看:111
本文介绍了当我尝试对其执行任何操作时,Visual Studio崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

再见一次.

如标题所示.

错误是:
PresentationCore.dll中发生了类型为"System.TypeInitializationException"的未处理异常

附加信息:"System.Windows.Automation.InvokePatternIdentifiers"的类型初始值设定项引发了异常.

通过一些谷歌搜索,一个人说如果没有正确安装任何字体,WPF将会崩溃,但是当我查看reg intries时,它们看起来都很好.

< quate from =" some =" guy =">
发生此问题的原因是Windows中的字体安装不正确.打开regedit.exe并导航到以下位置:

HKLM \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ Fonts

您可能会注意到,某些字体仅使用其字体名称进行注册(例如:times.ttf)

您可能还会注意到,某些字体已使用其在文件系统上位置的完整路径注册(例如:c:\ program files \ appName \ application \ fonts \ aaf.ttf)

如果未正确安装任何字体,WPF将中断. WPF仅在查找字体时才了解文件名;它无法导航文件系统路径.由于:"和"\"不是文件名中的有效字符,因此WPF不知道如何处理它并导致崩溃.

您需要进入注册表并确定哪些字体安装不正确,然后通过将字体文件移至c:\ windows \ fonts并编辑注册表项以仅包含字体名称来进行更正(操作系统知道可以查看c: \ windows \ fonts).

我已经为我的组织编写了修复程序,但是该代码是专有的.只需编写一个脚本,解析上面提到的注册表路径中的每个字体名称,并删除完整路径(但保留字体文件名).然后将字体从其当前位置复制到c:\ windows \ fonts.

同样,请检查此注册表分支中任何字体的无效字符.字体名称中的任何无效字符都将导致WPF崩溃.
br mode ="hold"/>
有解决办法吗?

在此先感谢.

---编辑---
字体注册表项

Hi All Again.

as the title says.

the error is:
An unhandled exception of type ''System.TypeInitializationException'' occurred in PresentationCore.dll

Additional information: The type initializer for ''System.Windows.Automation.InvokePatternIdentifiers'' threw an exception.

and through some googleing one person said that WPF will crash if any font is not installed correctly, but when i check out the reg intries, they all look fine.

<quate from="" some="" guy="">
This problem occurs because of improperly installed fonts in Windows. Open regedit.exe and navigate to the following:

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts

You may notice that some fonts are registered with just their font name (example: times.ttf)

You may also notice that some fonts are registered with the full path to their location on the file system (example: c:\program files\appName\application\fonts\aaf.ttf)

WPF will break if any font is installed improperly. WPF only understands file names when it comes to locating fonts; it cannot navigate filesystem paths. Since ‘:’ and ‘\’ aren’t valid characters in a filename, WPF doesn’t know how to handle it and crashes.

You need to go into the registry and determine which fonts are improperly installed, then correct it by moving the font file to c:\windows\fonts and editing the registry entry to just include the font name (the OS knows to look at c:\windows\fonts).

I’ve scripted a fix for my organization but the code is proprietary. Simply write a script that parses each font name in the registry path noted above and strip out the full path (but keep the font file name). Then copy the font from its current location to c:\windows\fonts.

As well, check for invalid characters in any font that is in this registry branch. Any invalid character in the font name will cause WPF to crash.
br mode="hold" />
is there a fix for this ?

Thanks in Advance.

---edit---
Font Reg Entries

推荐答案

这是Visual Studio 2010 beta版的一个已知问题(您的帖子没有说明您使用的是哪个版本).请确保您已为任何版本的Visual Studio应用了所有更新和修补程序.

您通过重新定位字体和更新注册表描述的修复听起来很危险,请在应用任何更改之前备份注册表,某些更改可能会产生意想不到的结果.

[edit]
http://www.bing.com/search?q = font + hotfix + visual + studio& qs = n& sk =& form = QBLH [
This is a known issue with the Visual Studio 2010 beta release (Your post does not say which version you are using) Make sure that you have applied all the updates and hotfixes for any version of Visual Studio.

The fix you describe with relocating the fonts and updating the registry sounds dangerous, back up the registry before applying any changes, some of the changes can have unintended results.

[edit]
http://www.bing.com/search?q=font+hotfix+visual+studio&qs=n&sk=&form=QBLH[^]


这篇关于当我尝试对其执行任何操作时,Visual Studio崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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