Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception using Merge Button on Team Explorer in Visual Studio Professional 2015

I'm getting an exception when I click on the merge button in team explorer in Visual Studio Professional 2015.

An exception has been encountered. This may be caused by an extension.
You can get more information by examining the file C:\Users\XXXX\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml'.

The contents of the ActivityLog.xml are as follows:

<record>775</record>
<time>2016/02/23 11:22:08.722</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>
    System.ArgumentNullException: Value cannot be null.&#x000D;&#x000A;Parameter name: key&#x000D;&#x000A;
    at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)&#x000D;&#x000A;
    at Microsoft.VisualStudio.Html.Package.Extensions.ExtensionsManager.OnTextViewCreated(ITextView textView, ITextBuffer textBuffer)&#x000D;&#x000A;
    at Microsoft.Web.Editor.Controller.TextViewConnectionListener.OnTextViewGotAggregateFocus(ITextView textView, ITextBuffer textBuffer)&#x000D;&#x000A;
    at Microsoft.VisualStudio.Html.Package.Commands.Html.VsHtmlTextViewConnectionListener.OnTextViewGotAggregateFocus(ITextView textView, ITextBuffer textBuffer)&#x000D;&#x000A;
    at Microsoft.Web.Editor.Controller.TextViewConnectionListener.&lt;&gt;c__DisplayClass24_0.&lt;OnTextViewConnected&gt;b__0(Object sender, EventArgs eventArgs)&#x000D;&#x000A;
    at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent(Object sender, EventHandler eventHandlers)
</description>
like image 264
Smartie Avatar asked Feb 23 '16 11:02

Smartie


1 Answers

We were running into this issue as well. Specifically, we noticed that VS 2015 Update 1 we were unable to manually merge conflicts in ".JSX" files. Using the following thread as inspiration: https://github.com/aspnet/Tooling/issues/293 we did the following to work around this issue for now. The example below is for JSX files, but this should work for any text-based file, just modify the instructions for your file type.

1) Point .JSX files at the HTML Editor:

  • Tools
  • Options
  • Text Editor
  • File Extension
  • Add jsx to the list, mapped to editor "HTML Editor"

2) Disable "identifying helpful extensions" for the HTML Editor:

  • Tools
  • Options
  • Text Editor
  • HTML
  • Advanced
  • "Extension Management" -> "Identify Helpful Extensions" -> False

That should work around the issue for now. The work-around being that we've tricked VS to not look for helpful extensions for .JSX files. I've submitted a VS bug report to MS.

My guess as to the underlying issue is that VS is "looking for helpful extensions" for "jsx" or other files for which it can't find any helpful extensions for. The result is the null ref / object not set to instance exception.

UPDATE:: According to Mads on GitHub , the issue has been fixed as part of the .NET Core Tooling Preview 1 for Visual Studio 2015. Thanks Burak_Karakuş for the comment!

UPDATE 2:: I've seen cases where this work-around didn't work. In that situation mapping the extension to "Source Code (Text) Editor with Encoding" resolved the crashing.

like image 98
MSC Avatar answered Nov 13 '22 13:11

MSC