当我尝试在 Visual Studio 2015 Update 2 中合并 cshtml 文件时,我不断收到此一般性错误,然后 VS 崩溃:我检查了日志,但它们根本没有帮助。如下所示,错误是遇到异常。这可能是由扩展引起的。
这可能是引发错误的地方。不确定
<entry>
<record>3863</record>
<time>2016/07/20 14:11:46.766</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.ArgumentNullException: Value cannot be null.
Parameter name: key
 at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
 at Microsoft.VisualStudio.Html.Package.Extensions.ExtensionsManager.OnTextViewCreated(ITextView textView, ITextBuffer textBuffer)
 at Microsoft.Web.Editor.Controller.TextViewConnectionListener.OnTextViewGotAggregateFocus(ITextView textView, ITextBuffer textBuffer)
 at Microsoft.VisualStudio.Html.Package.Commands.Html.VsHtmlTextViewConnectionListener.OnTextViewGotAggregateFocus(ITextView textView, ITextBuffer textBuffer)
 at Microsoft.Web.Editor.Controller.TextViewConnectionListener.<>c__DisplayClass24_0.<OnTextViewConnected>b__0(Object sender, EventArgs eventArgs)
 at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent(Object sender, EventHandler eventHandlers)</description>
</entry>
<entry>
这使得我必须手动合并我的 cshtml 文件。我尝试修复 VS 2015 并尝试禁用一堆扩展,但它仍然存在。
最佳答案
我想发布一个修复程序,因为我找不到它。我找到了这个 link在 GitHub 上,这建议我转到“工具”、“选项”、“文本编辑器”、“HTML”、“高级”,然后将 Identify Helpful Extensions 设置为 False。至少 ToddGrun 和其他一些人在一篇帖子中提出了这一建议。
在尝试再次合并之前,我继续并重新启动了 Visual Studio。不确定你是否必须这样做。
在那之后它起作用了。
关于c# - 合并 .cshtml 文件时 Visual Studio 2015 Update 2 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38485420/