Tooling: Merge tool with .cshtml file crashes Visual Studio with RC1 tools

Created on 21 Nov 2015  Â·  78Comments  Â·  Source: aspnet/Tooling

If I use the merge tool in VS 2015 while trying to resolve conflicts from a Git merge it will fail on some .cshtml files. This didn't seem to happen before installing the newer RC 1 tools this week.

I'm seeing this error message in C:\Users\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml

  <entry>
    <record>562</record>
    <time>2015/11/20 23:37:50.833</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>
  </entry>

Here is the info from About VS in case that is helpful

Microsoft Visual Studio Professional 2015
Version 14.0.23107.0 D14REL
Microsoft .NET Framework
Version 4.6.01038

Installed Version: Professional

Visual Basic 2015   00322-50050-03692-AA603
Microsoft Visual Basic 2015

Visual C# 2015   00322-50050-03692-AA603
Microsoft Visual C# 2015

Visual C++ 2015   00322-50050-03692-AA603
Microsoft Visual C++ 2015

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015 (RC)   14.1.11116.0
ASP.NET and Web Tools 2015 (RC)

ASP.NET Web Frameworks and Tools 2013   5.2.30624.0
For additional information, visit http://www.asp.net/

Azure App Service Tools v2.7.1   14.0.11112.0
Azure App Service Tools v2.7.1

CodeMaid   v0.8.1
CodeMaid is an open source Visual Studio extension to cleanup, dig through and simplify our C#, C++, F#, VB, PHP, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.

Written by Steve Cadwallader, for more information visit http://www.codemaid.net/

Common Azure Tools   1.6
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

GenerateUnitTest   1.0
Generates unit test code for methods in classes under test.

GitHub.VisualStudio   1.0
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

Microsoft Azure HDInsight HQL Service   2.0.2600.0
Language service for Hive query

Microsoft Azure HDInsight Tools for Visual Studio   2.0.2600.0
An integrated development environment for HDInsight application development.

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

Microsoft Azure Tools   2.7
Microsoft Azure Tools for Microsoft Visual Studio 2015 - v2.7.30818.1601

NuGet Package Manager   3.2.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   14.0.50730.0
Microsoft SQL Server Data Tools

WakaTime   1.0


Web Analyzer   1.4.48
Provides static analysis directly in Visual Studio for JavaScript, TypeScript, JSX, CSS and more

Web Essentials 2015   0.5.197
Adds many useful features to Visual Studio for web developers.

TFS Tracked

Most helpful comment

Does setting Tools->Options->Text Editor->Html->Advanced->Extension Management->Identify Helpful Extensions to false work around the issue for you?

All 78 comments

@ToddGrun

I can confirm it's happening with me as well... same exception dump. I'm doing a conflict resolution using source from TFS.

To make matters worse, it's crashing VS2015 when it launches the comparer.

However, a critical issue is that I can no longer open ANY cshtml file, VS2015 pops a message box "Object reference not set to an instance of an object" or "The operation cannot be completed".

I can open them using another editor, like XML (Text) Editor. It appears the HTML Editor is causing the issue

I'm also having problems with the merge tool and cshtml, though I don't get a crash, I just get "Failed to start the configured compare tool." The tool works with everything else in the project, and works on the file if I rename it to something that isn't .cshtml. The annotate tool also doesn't work, and that crashes Visual Studio.

A little more information related to the HTML Editor crash:

The HTML Editor only seems to crash when there are Razor elements in code file. For example:

@model IEnumerable<SomeClass>

<div>This is some HTML content with Razor</div>

Causes a crash while:

<div>This is some HTML content without Razor</div>
<div>Some more content</div>

Does not.

@slaneyrw Does this match your experience?

OK, I'm able to repro. Going to start taking a look into this.

same issue here. after vs.net 2015 update 1 update

TFS: 168882
I've added this to our internal TFS, we will reply back here soon.

Checked in a fix for this

How can we get this fix?

This issue has been fixed and checked in. It will be in the next release of the _ASP.NET and Web Tools_ tooling update. We don't yet know if that will be RC2 or if there will be canary (weekly updates) builds released before that

I need it working, urgently.
How to downgrade to the last version?

Does setting Tools->Options->Text Editor->Html->Advanced->Extension Management->Identify Helpful Extensions to false work around the issue for you?

Worked, thanks.

This is happening to me too, I'm using VS2015 Enterprise with Update 1 :S

ActivityLog.xml

  <entry>
    <record>843</record>
    <time>2015/12/03 15:53:40.472</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>
  </entry>

Visual Studio Info

Microsoft Visual Studio Enterprise 2015
Version 14.0.24720.00 Update 1
Microsoft .NET Framework
Version 4.6.01055

Installed Version: Enterprise

Architecture and Modeling Tools   00322-80000-00000-AA204
Microsoft Architecture and Modeling Tools

UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

Visual Basic 2015   00322-80000-00000-AA204
Microsoft Visual Basic 2015

Visual C# 2015   00322-80000-00000-AA204
Microsoft Visual C# 2015

Visual C++ 2015   00322-80000-00000-AA204
Microsoft Visual C++ 2015

Windows Phone SDK 8.0 - ESN   00322-80000-00000-AA204
Windows Phone SDK 8.0 - ESN

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015 (RC1 Update 1)   14.1.11120.0
ASP.NET and Web Tools 2015 (RC1 Update 1)

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.30624.0
For additional information, visit http://www.asp.net/

Azure App Service Tools v2.7.1   14.0.11112.0
Azure App Service Tools v2.7.1

Common Azure Tools   1.5
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

NuGet Package Manager   3.3.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   14.0.50730.0
Microsoft SQL Server Data Tools

TypeScript   1.7.4.0
TypeScript for Microsoft Visual Studio

Same problem with Visual Studio 2015 Update 1 RTM. When I click "Merge Changes in Tool", VS crashes and restart.


826

Error
Editor or Editor Extension
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)

+1

1010 ERROR 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.b__0(Object sender, EventArgs eventArgs) at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent(Object sender, EventHandler eventHandlers) Editor or Editor Extension 2015/12/10 14:09:25.059

+1

When can we expect a fix?

FYI - the workaround from @ToddGrun worked for me.

Does setting Tools->Options->Text Editor->Html->Advanced->Extension Management->Identify Helpful Extensions to false work around the issue for you?

The workaround from @ToddGrun worked for me also.

While waiting for the updated tooling to drop; the fix @ToddGrun suggested worked for me as well.

Phew! Thanks everyone, the fix suggested by @ToddGrun worked for me too!

Thanks @ToddGrun :+1:

The workaround from @ToddGrun just works partially. I can open my .cshtml files again, but TFS compare still throws "Error occurred during difference operation: Cannot execute the configured tool.". When can we expect a fix?

@ToddGrun is my hero!

Workaround does not work for me either... Should that be working in combination to some other assumption pre-requisite please?
For it happens straight in the solution explorer when I try and open a .cshtml file with using statement inside...
Happened after I installed WebCompiler and uninstalling it and restarting the solution did not solve it...

Ran into this issue when attempting to merge a conflict in VS. Thankfully, @ToddGrun's workaround has saved the day.

It is also happening to me

The @ToddGrun's workaround worked for me! Thanks @ToddGrun

@ToddGrun's workaraound did it!

Thank you @ToddGrun worked for me as well.

(Only thing that worked for me then was right click/open with and select the HTML editor...)

@ToddGrun I was experiencing the same error and your proposed workaround worked for me as well.

Visual Studio Enterprise 2015
Version 14.0.24720.00 Update 1

Confirmed, this is still an issue with VS2015 Update 1 and the latest ASP.NET web tools installation. Workaround worked for me and also disabled the annoying "do you want to install this helpful extension?" bar at the top as an added bonus, thanks

The workaround from @ToddGrun worked for me.

This is still an issue and I have all the latest releases.

The workaround from @ToddGrun worked for me too. I am using Git with Visual Studio Online.

Thanks @ToddGrun. Workaround works perfectly with VS2015 Update 1. Will test again with the next VS update.

@ToddGrun I am running VS2015 Update 1 with TFS and it worked for me. Thanks!

@ToddGrun Thank you, worked.

I also have this issue. @ToddGrun workaround works.

Had same issue. Thanks to @ToddGrun for the fix.

Visual Studio Professional 2015
Version 14.0.24720.00 Update 1

@ToddGrun you legend. I was encountering this error every time I opened my ASP.Net MVC solution.

This is happening to me when trying to merge a .cshtml page using VS 2015 Enterprise. Any Fix.

Had the same issue appearing since yesterday, disabled the Identify Helpful Extensions option like @ToddGrun mentioned and that fixed it.

I experienced the same issue today merging an Html File: Clicking merge crashed VS multiple times. WorkAround by @ToddGrun fixed the issue for me.

Visual Studio Professional 2015
Version 14.0.24720.00 Update 1

Thx @ToddGrun worked!

Thx @ToddGrun worked!

Issue still appears after installing Update 2. The fix of @ToddGrun worked for me aswell.

Thank you @ToddGrun, you just made my friday more awesome!

Mmm, my VS crashes the moment I get to Tools->Options->Text Editor->Html. So I @ToddGrun's suggestion doesn't work for me :(. Any other ideas?

I have tried @ToddGrun's work-around, and it worked for a while. The bug seems to be back however. I still have @ToddGrun's suggestion on, but merging still crashes VS.

Thanks @ToddGrun, saved me on VS2015 Update 1!

This problem was even in VS2015 Update 2
but @ToddGrun's solution worked like a charm for me
Thanks Todd

+1 for in VS 2015 Update 2, disabling the extensions tool, worked at least for this particular merge.

Please notify whoever owns the extension or just remove it all together. I've asked it to stop notifying me with the 'dont ask again' and that never works either.

Thanks for the workaround @ToddGrun.

have a good one.

VS2015 version 14.0.25123.00 Update 2 also with this issue, but the method from @ToddGrun not working for me, is any other approach to fix?

@ToddGrun :+1: thx man ! your workaround worked for me also/

@ToddGrun Dude you saved my evening. Cheers!

I am using Visual Studio 2015 Update 2 with Microsoft ASP.NET and Web Tools version 14.1.20203.0 on Windows 10 and this is still an issue. The workaround provided by @ToddGrun works for me.

Running update 2 on vs2015, same crash, but thankfully the workaround works. I'm merging a regular .html file, not even a cshtml.

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)

Echoing what @oising said - same exception, same work around works. Running a Fully up-to-date VS2015 with Update 2.

Given that this issue is already closed, can we re-open it or create a new issue for tracking purposes?

@vcsjones @madskristensen Agreed. I don't know why this is closed. It's not fixed in update 2.

Change the value from true to false as below:
image

After set false, VS2015 update 2 will not be crashed on opening *.chtml files any more.

If they can't fix this issue after two point releases, I suggest they take the easier route and update the text from "Identify Helpful Extensions" to "Crash when merging files", and default it to False.

;-)

On a more serious note, @madskristensen -- why is this closed? The issue is still trivially reproducible in update 2.

@tomexou Your solution worked for me. Thank you for posting it.

@tomexou @ToddGrun The workaround solved a problem trying to resolve a markdown (.md) merge conflict in VS2015 update 2. Looking forward to a permanent fix...

Ping - any chance of reopening this?

The fix for this issue was released in the new ASP.NET Core RC2 tooling

Just ran into this issue and installing ASP.NET Core RC2 tooling for visual studio 2015 fixed it for me. I'm no longer getting an error that crashes visual studio when opening the merge tool. Thanks @madskristensen

ping any update on correction?

@MarcusPozzan It's fixed in the .NET Core Tooling Preview 1 for Visual Studio 2015

Thanks @ToddGrun ! It worked!

how is this still a problem...

This just confirm my impression that VS2015 is probably the biggest piece of crap software I've ever used. VS 2015 is by far the worst version so far and each update only seem to make it even worse. And I've been using it since 1997 so I have lots of Visual Studio versions to compare it with. We are seriously considering giving up on .NET all together as there as just so many problems these days :(

And why is this case closed when the problem is obviously still there??

@improwise I'm not sure it's that bad. These guys do an amazing job with a product that has been through so many different iterations. It's practically impossible to have something completely bug free. Users will be users. We use .net all the time and don't have 'so many problems these days' However, you are always more than welcome to create your own product, plus, there's always notepad++.
that NEVER crashes.

Happy Coding

@brentdavid2008 Main problem is that it seems to get worse with every attempt to fix something. The Update packages seem to cause as many problems as they fix. Merge crashing, save buttons not working, frequent crashes, memory consumption increasing, lots of freezes and delays and so on. Even copy & paste does not working sometimes! Even my colleagues that has always praised Visual Studio as the best IDE (I used to be one of them) have now kind of given up on VS2015 and many has gone back to Visual Studio 2013 just to get some real work done and not just trying to figure out workaround to IDE problems constantly. I really hope MS gets their act together here...

And I completely agree on Notepad++, had VS2015 been anything close to that, I would be very very happy :)

Get the community edition not the RC...jeez. RC is a release candidate.
Your wrong for even posting this issue :-)

On Sat, Aug 20, 2016 at 12:42 PM, improwise [email protected]
wrote:

@brentdavid2008 https://github.com/brentdavid2008 Main problem is that
it seems to get worse with every attempt to fix something. The Update
packages seem to cause as many problems as they fix. Merge crashing, save
buttons not working, even copy & paste not working sometimes. Even my
colleagues that has always praised Visual Studio as the best IDE (I used to
be one of them) have now kind of given up on VS2015 and many has gone back
to Visual Studio 2013 just to get some real work done and not just trying
to figure out workaround to IDE problems constantly. I really hope MS gets
their act together here...

And I completely agree on Notepad++, had VS2015 been anything close to
that, I would be very very happy :)

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/aspnet/Tooling/issues/293#issuecomment-241210194, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AI2CpONv5SQsWj5Gg0dANnFKglew_Hveks5qhy5qgaJpZM4GmyhV
.

Not sure who you are referring to, if it is me I run Visual Studio Update 3 Patch 1 but was lead hear as I was googling to try to to solve one of the many problems with VS2015.

This suggestion from @ToddGrun worked for me:

Tools->Options->Text Editor->Html->Advanced->Extension Management->Identify Helpful Extensions to false is a work around the issue.
Thanks @ToddGrun

The issue is still present in Visual Studio 2015 Update 3. The solution offered by @ToddGrun is already valid and it has worked for me.

I still got this bug in Visual Studio 2015 Professional Update 3. I installed.NET Core 1.0.1 - VS 2015 Tooling Preview 2 and this fixed the issue for now.

Was this page helpful?
0 / 5 - 0 ratings