问题描述
我已经使用 VS2010 几个星期了,但在过去的几天里它完全无法使用.当我在编辑器中输入任何内容时,Visual Studio 会抛出异常,然后我会收到很多智能错误(代码很好,如果我在尝试使用编辑器之前运行,我可以编译它) - 这是日志消息:
I have been using VS2010 for a few weeks but for the past few days it has been totally unusable. When I type anything into the editor Visual Studio throws an exception, then I get lots of intellisence errors (the code is fine, I can compile it if I run before trying to use the editor) - here is the log message:
<entry>
<record>241</record>
<time>2011/01/25 08:30:34.109</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.VisualStudio.TextManager.Interop.IVsTextReplaceEvents'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{CF9928D9-65AE-4319-A446-94ED5C45ECDE}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
 at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, Boolean& pfNeedsRelease)
 at Microsoft.VisualStudio.TextManager.Interop.IVsTextReplaceEvents.OnReplace(ChangeInput[] pCI)
 at Microsoft.VisualStudio.Editor.Implementation.VsTextBufferAdapter.OnTextBufferChangedHighPriority(Object sender, TextContentChangedEventArgs e)
 at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent[TArgs](Object sender, EventHandler`1 eventHandlers, TArgs args)</description>
</entry>
<entry>
<record>242</record>
<time>2011/01/25 08:30:34.125</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.VisualStudio.Editor.Implementation.IVsTextStreamEvents_Private'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{96FC7D44-BCDD-4F00-AE4D-07E26B2C0E52}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
 at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, Boolean& pfNeedsRelease)
 at Microsoft.VisualStudio.Editor.Implementation.IVsTextStreamEvents_Private.OnChangeStreamText(Int32 iPos, Int32 iOldLen, Int32 iNewLen, Int32 fLast)
 at Microsoft.VisualStudio.Editor.Implementation.VsTextBufferAdapter.OnTextBufferChanged(Object sender, TextContentChangedEventArgs e)
 at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent[TArgs](Object sender, EventHandler`1 eventHandlers, TArgs args)</description>
</entry>
推荐答案
这似乎是因为您计算机上的注册表中缺少某些信息.如果您访问 MS Connect 网站,您会发现有关此问题的讨论问题以及似乎是解决方案的方法.
This seems like it might be due to some info missing from the registry on your computer. If you go to the MS Connect website you'll find a discussion about this issue and what seems to be a solution as well.
解决方案(从该页面复制):
Solution (copied from that page):
使用regedit查看如下key:
Using regedit look at the following key:
在 32 位 Windows 上:[HKEY_CLASSES_ROOT\CLSID\{73B7DC00-F498-4ABD-AB79-D07AFD52F395}\InProcServer32]
在 64 位 Windows 上:[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{73B7DC00-F498-4ABD-AB79-D07AFD52F395}\InProcServer32]
On 32-Bit Windows: [HKEY_CLASSES_ROOT\CLSID\{73B7DC00-F498-4ABD-AB79-D07AFD52F395}\InProcServer32]
On 64-Bit Windows: [HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{73B7DC00-F498-4ABD-AB79-D07AFD52F395}\InProcServer32]
(默认)"值应为以下值之一:
在 32 位 Windows 上:"C:\Program Files\Common Files\Microsoft Shared\MSEnv\TextMgrP.dll"
在 64 位 Windows 上:"C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\TextMgrP.dll"
The "(Default)" value should be one of the following:
On 32-Bit Windows: "C:\Program Files\Common Files\Microsoft Shared\MSEnv\TextMgrP.dll"
On 64-Bit Windows: "C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\TextMgrP.dll"
这篇关于在编辑器中键入时 Visual Studio 崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!