我在 Windows Server 2012 上安装了 Visual Studio 2012 RTM Plus 更新和 Web Essentials 2012 V1.7,当我打开 CSS 文件时出现以下崩溃。
System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Web.Editor.ComponentLocatorWithOrdering
2.ImportMany() at Microsoft.Web.Editor.ComponentLocatorForContentType
1.FindFirstOrderedComponent(String contentTypeName) at Microsoft.CSS.Editor.CssEditorDocument.InitializeTextBuffer(ITextBuffer textBuffer) at Microsoft.CSS.Editor.CssEditorDocument.FromTextBuffer(ITextBuffer textBuffer) at MadsKristensen.EditorExtensions.DisplayInlineTextViewCreationListener.SubjectBuffersConnected(IWpfTextView textView, ConnectionReason reason, Collection`1 subjectBuffers) at Microsoft.VisualStudio.Text.Editor.Implementation.ConnectionManager.<>c_DisplayClass8.<.ctor>b_1() at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call)
我已经以另一个用户而不是本地管理员身份登录,但我仍然遇到崩溃。 (我必须以具有管理员权限的普通用户身份登录,因为我猜出于安全原因,某些 ide 不会在本地管理员的上下文中运行)。
我已经卸载、重新安装、执行 devenv/resetuser data,但它仍然崩溃。
如果我卸载 Web Essentials 2012 v1.7(和 1.4、1.5 等),它就会停止崩溃。在 V1.4 之前,我相信它工作正常。可能是环境中发生冲突的其他扩展,如工作台工具,但我看不到任何添加的东西,我已经卸载了我能想到的所有东西。
我想追踪这个错误并了解扩展安装顺序并尝试了解它要做什么,这样我就有了一些可能影响它的线索。
上一个条目
"Begin package load [Visual Studio CSS Editing Package] {A764E895-518D-11D2-9A89-00C04F79EFC3} VisualStudio 2012/11/12 12:10:02.504 484 Loading UI library C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Packages*\CSSPkgUI.dll {A764E895-518D-11D2-9A89-00C04F79EFC3} VisualStudio 2012/11/12 12:10:02.504 485 End package load [Visual Studio CSS Editing Package] {A764E895-518D-11D2-9A89-00C04F79EFC3} VisualStudio 2012/11/12 12:10:02.505 "
据我所知,Microsoft Web 编辑器正试图将编辑缓冲区的内容移交给 Web Essentials Editor 扩展并崩溃。
事件日志
Application: devenv.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.NullReferenceException Stack: at Microsoft.Web.Editor.ComponentLocatorWithOrdering
2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].ImportMany() at Microsoft.Web.Editor.ComponentLocatorForContentType
1[[System._Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].FindFirstOrderedComponent(System.String) at Microsoft.CSS.Editor.CssEditorDocument.InitializeTextBuffer(Microsoft.VisualStudio.Text.ITextBuffer) at Microsoft.CSS.Editor.CssEditorDocument.FromTextBuffer(Microsoft.VisualStudio.Text.ITextBuffer) at MadsKristensen.EditorExtensions.HighlightWordTagger.EnsureInitialized() at MadsKristensen.EditorExtensions.HighlightWordTagger.UpdateAtCaretPosition(Microsoft.VisualStudio.Text.Editor.CaretPosition) at MadsKristensen.EditorExtensions.HighlightWordTagger+<>c_DisplayClass3.b__2() at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
我注意到它提到了 highlightword
标记器。那是线索吗? (或者只是第一个调用点?),我也没有在 html 文件中突出显示颜色语法。
我在一台单独的 Windows 8 笔记本电脑上也多次遇到同样的崩溃,有一天,在我卸载并重击它之后,错误就消失了,我尝试了很多禁用、启用、往返,很难想象会发生什么已经修好了。
是否有任何其他日志可供我追踪?
最佳答案
这在最新的每晚构建中得到修复。您可以在这里获取:http://madskristensen.net/custom/webessentials2012.vsix?v=1.7.4
安装 nightly 不会影响将来通过 VS 自动安装的任何更新。
关于css - 尝试打开 CSS 文件时 Visual Studio 2012 和 Web Essentials 2012 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13345018/