遇到了一个例外。这可能是由Visual Studio 2013

时间:2016-11-02 08:40:01

标签: visual-studio visual-studio-2013

我正在使用带有更新3的VS-2013 Premium。在调试代码时和尝试进入时,我收到此错误消息框: 遇到了一个例外。这可能是由扩展名

引起的

当输入日志文件时(消息中提到了路径),我得到了这个例外:

<entry>
<record>920</record>
<time>2016/11/02 08:21:03.224</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.InvalidOperationException:   EndBatchUpdate                called without BeginBatchUpdate being called&#x000D;&#x000A;

at Microsoft.VisualStudio.Text.Classification.Implementation.EditorFormatMap.EndBatchUpdate()&#13;
在Microsoft.VisualStudio.Text.Classification.Implementation.ClassificationFormatMap.EndBatchUpdate()&#13;
 在Microsoft.VisualStudio.Editor.Implementation.MarkerType.UpdateMarkerFormat(String markerName,IClassificationType classificationType)&#13;    在Microsoft.VisualStudio.Editor.Implementation.MarkerType.EnsureLazyStateInitialized()&#13;     在Microsoft.VisualStudio.Editor.Implementation.MarkerManager.GetErrorTags(NormalizedSnapshotSpanCollection spans)&#13;    在Microsoft.VisualStudio.Editor.Implementation.MarkerManager.ErrorTaggerImplementation.GetTags(NormalizedSnapshotSpanCollection spans)&#13;    在Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1。&lt; GetTagsForBuffer&gt; d__5.MoveNext()   

相同的条目超过4次。即使我删除了组件缓存模型,但问题仍未解决:

C:\ Users \ User name \ AppData \ Local \ Microsoft \ VisualStudio \ 12.0

其他错误如下:          891     2016/11/02 08:21:02.023     错误     编辑或编辑扩展     System.InvalidOperationException:IWpfTextView.TextViewLines无效。&#13;    在Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.Microsoft.VisualStudio.Text.Editor.IWpfTextView.get_TextViewLines()&#13;    在Microsoft.VisualStudio.Text.AdornmentLibrary.TextMarkers.Implementation.TextMarkerVisualManager.OnFormatMappingChanged(Object sender,FormatItemsEventArgs e)&#13;    在System.EventHandler 1.Invoke(Object sender, TEventArgs e)&#x000D;&#x000A; at Microsoft.VisualStudio.Text.Classification.Implementation.ViewSpecificFormatMap.EditorFormatMapChanged(Object sender, FormatItemsEventArgs e)&#x000D;&#x000A; at System.EventHandler 1.Invoke(Object sender,TEventArgs e)&#13;    在Microsoft.VisualStudio.Text.Classification.Implementation.EditorFormatMap.SendChangedEvent()&#13;    在Microsoft.VisualStudio.Text.Classification.Implementation.EditorFormatMap.SetProperties(String key,ResourceDictionary properties)&#13;    在Microsoft.VisualStudio.Text.Classification.Implementation.ClassificationFormatMap.SetExplicitTextProperties(IClassificationType classificationType,TextFormattingRunProperties properties)&#13;    在Microsoft.VisualStudio.Text.Classification.Implementation.ClassificationFormatMap.AddExplicitTextProperties(IClassificationType classificationType,TextFormattingRunProperties properties,IClassificationType priority)&#13;    在Microsoft.VisualStudio.Editor.Implementation.FontsAndColorsHelper.UpdateLegacyMarkerClassification(IClassificationFormatMap classificationFormatMap,IClassificationType classificationType,ColorableItemInfo [] info)&#13;    在Microsoft.VisualStudio.Editor.Implementation.MarkerType.UpdateMarkerFormat(String markerName,IClassificationType classificationType)&#13;    在Microsoft.VisualStudio.Editor.Implementation.MarkerType.EnsureLazyStateInitialized()&#13;    在Microsoft.VisualStudio.Editor.Implementation.MarkerManager。&lt; GetClassificationTags&gt; d__15.MoveNext()&#13;    在Microsoft.VisualStudio.Editor.Implementation.TextMarkerViewTagger。&lt; GetTags&gt; d__0.MoveNext()&#13;    在Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1。&lt; GetTagsForBuffer&gt; d__5.MoveNext()   

<entry>
<record>853</record>
<time>2016/11/02 08:19:10.020</time>
<type>Error</type>
<source>Color Theme Service</source>
<description>The color &apos;Popup&apos; in category &apos;de7b1121-99a4-4708-aedf-15f40c9b332f&apos; does not exist.</description>

<entry>
<record>878</record>
<time>2016/11/02 08:19:12.567</time>
<type>Error</type>
<source>Extension Manager</source>
<description>Extension will not be loaded because an extension with the same ID &apos;Microsoft.Windows.DevelopmentKit.Desktop&apos; is already loaded at C:\PROGRAM FILES (X86)\COMMON FILES\MICROSOFT\EXTENSIONMANAGER\EXTENSIONS\MICROSOFT\WINDOWS KITS\8.0\DESKTOP SDK\...</description>
<path>C:\PROGRAM FILES (X86)\COMMON FILES\MICROSOFT\EXTENSIONMANAGER\EXTENSIONS\MICROSOFT\WINDOWS KITS\8.1\DESKTOP SDK\</path>

3 个答案:

答案 0 :(得分:12)

转到工具 - &gt;扩展和更新并禁用此处的所有添加。重新启动visual studio。 问题会解决。 希望这会对其他人有所帮助。

答案 1 :(得分:0)

自从提出这个问题多年后,我遇到了这个问题。所以,这个答案是为那些使用 Visual Studio 2019 的人准备的。

您所要做的就是:Extensions > Manage Extensions > Updates > Update All/Update [what you want]

还建议更新 Visual Studio 本身(如果有可用更新)。

注意:Extensions 菜单位于 ToolsWindow 之间。

答案 2 :(得分:-1)

在我的情况下,我在文本框中放了onfocus和模糊,然后将script type = text javascript + function放进去,然后出现错误消息。当我仅评论脚本和函数时,错误消息不再显示。