简体   繁体   English

在Visual Studio Professional 2015中使用团队资源管理器上的合并按钮的异常

[英]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. 当我在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: ActivityLog.xml的内容如下:

<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>

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. 具体来说,我们注意到VS 2015 Update 1我们无法手动合并“.JSX”文件中的冲突。 Using the following thread as inspiration: https://github.com/aspnet/Tooling/issues/293 we did the following to work around this issue for now. 使用以下线程作为灵感: https//github.com/aspnet/Tooling/issues/293我们现在执行以下操作来解决此问题。 The example below is for JSX files, but this should work for any text-based file, just modify the instructions for your file type. 下面的示例适用于JSX文件,但这适用于任何基于文本的文件,只需修改文件类型的说明即可。

1) Point .JSX files at the HTML Editor: 1)在HTML编辑器中指向.JSX文件:

  • Tools 工具
  • Options 选项
  • Text Editor 文本编辑器
  • File Extension 文件扩展名
  • Add jsx to the list, mapped to editor "HTML Editor" 将jsx添加到列表中,映射到编辑器“HTML Editor”

2) Disable "identifying helpful extensions" for the HTML Editor: 2)禁用HTML编辑器的“识别有用扩展”:

  • Tools 工具
  • Options 选项
  • Text Editor 文本编辑器
  • HTML 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. 解决方法是我们欺骗VS而不寻找.JSX文件的有用扩展。 I've submitted a VS bug report to MS. 我已向MS提交了VS错误报告。

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. 我对底层问题的猜测是,VS正在为“jsx”寻找有用的扩展,或者找不到任何有用扩展的其他文件。 The result is the null ref / object not set to instance exception. 结果是null ref / object未设置为实例异常。

UPDATE: : According to Mads on GitHub , the issue has been fixed as part of the .NET Core Tooling Preview 1 for Visual Studio 2015 . 更新::根据Mads on GitHub ,该问题已作为Visual Studio 2015.NET核心工具预览1的一部分得到修复。 Thanks Burak_Karakuş for the comment! 感谢Burak_Karakuş的评论!

UPDATE 2: : I've seen cases where this work-around didn't work. 更新2 ::我已经看到这种解决办法不起作用的情况。 In that situation mapping the extension to "Source Code (Text) Editor with Encoding" resolved the crashing. 在那种情况下,将扩展名映射到“带编码的源代码(文本)编辑器”解决了崩溃问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM