【问题标题】:Visual Studio 2012 and Web Essentials 2012 Crashing when trying to open a CSS file尝试打开 CSS 文件时,Visual Studio 2012 和 Web Essentials 2012 崩溃
【发布时间】:2013-02-12 02:29:46
【问题描述】:

我在 Windows Server 2012 上安装了 Visual Studio 2012 RTM Plus 更新和 Web Essentials 2012 V1.7,当我打开 CSS 文件时出现以下崩溃。

System.NullReferenceException:对象引用未设置为实例 的一个对象。在 Microsoft.Web.Editor.ComponentLocatorWithOrdering2.ImportMany() at Microsoft.Web.Editor.ComponentLocatorForContentType1.FindFirstOrderedComponent(String contentTypeName) 在 Microsoft.CSS.Editor.CssEditorDocument.InitializeTextBuffer(ITextBuffer 文本缓冲区)在 Microsoft.CSS.Editor.CssEditorDocument.FromTextBuffer(ITextBuffer 文本缓冲区)在 MadsKristensen.EditorExtensions.DisplayInlineTextViewCreationListener.SubjectBuffersConnected(IWpfTextView textView,ConnectionReason 原因,Collection`1 subjectBuffers)在 Microsoft.VisualStudio.Text.Editor.Implementation.ConnectionManager.c_DisplayClass8.<.ctor>b_1() 在 Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(对象 errorSource,Action 调用)

我以其他用户而不是本地管理员身份登录,但我仍然遇到崩溃。 (我必须以具有管理员权限的普通用户身份登录,因为我猜出于安全原因,某些 ide 不会在本地管理员的上下文中运行)。

我已经卸载、重新安装、执行 devenv / resetuser 数据,但它仍然崩溃。

如果我卸载 Web Essentials 2012 v1.7(和 1.4、1.5 等),它将停止崩溃。在 V1.4 之前,我相信它工作正常。可能是环境中的其他扩展发生冲突,例如工作台工具,但我看不到任何添加内容,并且我已经卸载了我能想到的所有内容。

我想追踪这个错误并了解扩展安装顺序,并尝试了解它将要做什么,以便我对可能影响它的任何事情有一些线索。

上一个条目

"开始包加载【Visual Studio CSS 编辑包】 {A764E895-518D-11D2-9A89-00C04F79EFC3} VisualStudio 2012/11/12 12:10:02.504 484 加载 UI 库 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 结束包加载 [Visual Studio CSS 编辑 包] {A764E895-518D-11D2-9A89-00C04F79EFC3} VisualStudio 2012/11/12 12:10:02.505"

据我所知,Microsoft Web 编辑器正试图将编辑缓冲区的内容移交给 Web Essentials Editor 扩展并崩溃。

事件日志

应用程序:devenv.exe 框架版本:v4.0.30319 描述: 由于未处理的异常,进程被终止。异常信息: System.NullReferenceException 堆栈:在 Microsoft.Web.Editor.ComponentLocatorWithOrdering2[[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.ComponentLocatorForContentType1[[System._Canon, mscorlib,版本=4.0.0.0,文化=中性, PublicKeyToken=b77a5c561934e089]].FindFirstOrderedComponent(System.String) 在 Microsoft.CSS.Editor.CssEditorDocument.InitializeTextBuffer(Microsoft.VisualStudio.Text.ITextBuffer) 在 Microsoft.CSS.Editor.CssEditorDocument.FromTextBuffer(Microsoft.VisualStudio.Text.ITextBuffer) 在 MadsKristensen.EditorExtensions.HighlightWordTagger.EnsureInitialized() 在 MadsKristensen.EditorExtensions.HighlightWordTagger.UpdateAtCaretPosition(Microsoft.VisualStudio.Text.Editor.CaretPosition) 在 MadsKristensen.EditorExtensions.HighlightWordTagger+c_DisplayClass3.b__2() 在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) 在 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate、System.Object、Int32、System.Delegate)在 System.Windows.Threading.DispatcherOperation.InvokeImpl() 在 System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object) 在 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback,System.Object,布尔值)在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback,System.Object,布尔值)在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback,System.Object)在 System.Windows.Threading.DispatcherOperation.Invoke() 在 System.Windows.Threading.Dispatcher.ProcessQueue() 在 System.Windows.Threading.Dispatcher.WndProcHook(IntPtr,Int32,IntPtr, MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) 在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object) 在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) 在 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate、System.Object、Int32、System.Delegate)在 System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32) 在 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)

我注意到它提到了highlightword 标记器。这是一个线索吗? (或者只是第一个调用点?),我也没有在 html 文件中突出显示颜色语法。

我也在一台单独的 Windows 8 笔记本电脑上多次遇到同样的崩溃,有一天,在我坐下来卸载并将其撞死后,错误就消失了,我尝试了如此多的禁用、启用、往返,很难想象会发生什么已经修好了。

还有其他日志可以用来追踪吗?

【问题讨论】:

  • 代码格式和块引用格式对这篇文章有很大帮助。

标签: css visual-studio-2012


【解决方案1】:

这已在最新的夜间版本中修复。你可以在这里抓住它:http://madskristensen.net/custom/webessentials2012.vsix?v=1.7.4

安装 nightly 不会影响以后通过 VS 自动安装的任何更新。

【讨论】:

  • 感谢 Mads,遗憾的是它没有帮助。我之前也试过修理。我对颜色语法高亮在 html 和 css 文件中的位置感到困惑。我会尝试完全卸载,但感觉环境中有些杂乱无章。
  • 嗨,Mads,我执行了卸载、重新启动、重新安装、开发 /resetuserdata,然后创建了一个新的网上商店应用程序并得到了……“'EditorExtensionsPackage' 包没有正确加载。结果要成为本地扩展缓存记得之前的安装。我安装了 Web Essentials 2012 v1.7,但我仍然遇到同样的错误。见下文
  • Microsoft.CSS.Editor.CssEditorDocument.FromTextBuffer(ITextBuffer textBuffer) 在 MadsKristensen.EditorExtensions.DisplayInlineTextViewCreationListener.SubjectBuffersConnected(IWpfTextView textView,ConnectionReason 原因,Collection`1 subjectBuffers) 在 Microsoft.VisualStudio.Text.Editor.Implementation.ConnectionManager.<>c__DisplayClass8.<.ctor>b__1() 在 Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(对象错误源,操作调用)
  • 刚刚尝试了网络平台安装程序并获得了网络工具 1.1。这个环境被 VS2012 Express 污染了,因为安装程序认为 VS 2012 版本可以相互分散,而不是检测到已经安装了更高版本。似乎没有办法像往常一样清理整个系统,所以我们面临着一个完整的系统重建,但我会尽量避免这种情况。
  • 呸呸呸,我要再次卸载并找到包缓存,删除它们,这次从 ISO 运行安装。 (希望它不会对 VS2012 进行任何更新)。
【解决方案2】:

我确实重建了我的机器,当然我再也没有看到过错误。然而,我确实选择重建为 Windows 8 PC 而不是 Windows 2012 Server 作为我的开发机器。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-10
    相关资源
    最近更新 更多