Visual Studio 经常抛出异常

6

Visual Studio 2015经常变得诡异。

键入的键以半随机顺序出现,有时我必须按两次或更多次键。

我认为这似乎是围绕关键字而不是变量名或文字的。

大约五分钟后,我将收到错误对话框,告诉我可能由扩展引起异常。

ActivityLog.xml中的条目如下:

<entry>
  <record>762</record>
  <time>2015/08/11 20:17:02.056</time>
  <type>Error</type>
  <source>Editor or Editor Extension</source>
  <description>System.InvalidOperationException: IWpfTextView has not completed its layout.&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.PerformLayout(ITextSnapshot newSnapshot, ITextSnapshot newVisualSnapshot, SnapshotPoint anchorPosition, Double verticalDistance, ViewRelativePosition relativeTo, Double effectiveViewportWidth, Double effectiveViewportHeight, Boolean preserveViewportTop, Nullable`1 cancel)&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.DisplayTextLineContainingBufferPosition(SnapshotPoint bufferPosition, Double verticalDistance, ViewRelativePosition relativeTo, Nullable`1 viewportWidthOverride, Nullable`1 viewportHeightOverride)&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.DisplayTextLineContainingBufferPosition(SnapshotPoint bufferPosition, Double verticalDistance, ViewRelativePosition relativeTo)&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.InterTextAdornmentSupport.Implementation.InterLineAdornmentManager.PerformLayout(SnapshotPoint trackingPoint)&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.InterTextAdornmentSupport.Implementation.InterLineAdornmentManager.OnBatchedTagsChanged(Object sender, BatchedTagsChangedEventArgs e)&#x000D;&#x000A;   at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent[TArgs](Object sender, EventHandler`1 eventHandlers, TArgs args)</description>
</entry>

发生了什么?我该如何修复或进一步诊断此问题?

Visual Studio的详细信息

Microsoft Visual Studio Enterprise 2015
Version 14.0.23107.0 D14REL
Microsoft .NET Framework
Version 4.6.00081

Installed Version: Enterprise

Architecture and Modeling Tools   00322-80000-00000-AA490
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-AA490
Microsoft Visual Basic 2015

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

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

Visual F# 2015 RC   00322-80000-00000-AA490
Microsoft Visual F# 2015 RC

Windows Phone SDK 8.0 - ENU   00322-80000-00000-AA490
Windows Phone SDK 8.0 - ENU

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

ASP.NET and Web Tools   14.0.20626.0
ASP.NET and Web Tools

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

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

Developer Assistant   1.0
Developer Assistant puts millions of code snippets and code sample projects at your fingertips while you are coding in Visual Studio.

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

JetBrains ReSharper Ultimate 2015.1.2   Build 102.0.20150721.105606
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2015 JetBrains, Inc.

Microsoft Azure HDInsight HQL Service   2.0.1000.0
Language service for Hive query

Microsoft Azure HDInsight Tools for Visual Studio   2.0.1000.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.6
Microsoft Azure Tools for Microsoft Visual Studio 2015 - v2.6.30508.1601

Microsoft Code Digger   0.9
Microsoft Code Digger

Microsoft.Pex.VisualStudio   1.0
Pex

NCrunch   
Continuous Testing Tool for .NET
Copyright © 2010-2015 Remco Software Ltd

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

OneCodeQuickLaunchPackage   1.0
Information about my package

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

SQL Server Data Tools   14.0.50717.0
Microsoft SQL Server Data Tools

Visual C++ for Cross Platform Mobile Development   1.0
Visual C++ for Cross Platform Mobile Development

Xamarin   3.11.450.0 (2ab5145)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   5.1.0.115 (d23da369e436488f38c8ab8fe8a9ae7d9ea5256b)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   8.10.0.0 (7741cc495ab0baf04ff0405d0604bc27f0ecae2e)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration   1.0
Automated migration for Xamarin iOS Classic projects to Unified

Xamarin.TestCloud.Integration   1.0
Early preview of Xamarin Test Cloud integration

更新

  1. 卸载 NCrunch 并没有解决问题。
  2. 卸载 NCrunch 和 Resharper 9 似乎已经修复了问题。
  3. 只重新安装 Resharper 看起来是可以的。
  4. 我在之后重新安装了 NCrunch。
  5. 一个月过去了,目前一切看起来都没问题,我还没尝试重新安装 NCrunch。

2
有一件事引起了我的注意,那就是 NCrunch。我没有见过这个,但另一个用户似乎报告了类似的问题,这是你所经历的吗?你使用的是 Windows 10 吗?http://forum.ncrunch.net/yaf_postst1631_slow-typing-in-VS2015.aspx - Amanda Lange
看起来确实很相似,我会将其禁用并观察发生了什么。 - BanksySan
是的!就是这样,一旦我禁用它,用户界面就变得流畅了,重新启用它,立即我就不得不按两次回车键。我会关闭它几天以确保它没有问题。 - BanksySan
1
@AmandaLange 把它放在答案里,你也可以声称那些美味的声誉分。 - BanksySan
@BanksySan 说实话,我只在使用Resharper时遇到了这个确切的行为/问题(除非我们还在使用另一个常见的扩展名,但似乎不是这样)。 - Zachary Dow
显示剩余2条评论
2个回答

1
我一直遇到这个问题,只出现在Resharper (9.1.X)中。
我在卸载时引用了这个线程。我收到了来自支持团队的电子邮件,要求我尝试一些9.2版本的发布候选版。只要9.2没有正式发布,如果您愿意承担一些风险,尝试它们可能是值得的。

https://confluence.jetbrains.com/display/ReSharper/ReSharper+9.2+EAP

我开始尝试RC3,稍后会回来编辑我的经验。我认为最好尽早提出可能的解决方案,无论我的经验如何。
他们刚刚发布了Resharper 9.2。我会看看安装它是否可以解决问题。
或者,this answer对我个人有帮助,以防新版本无法解决问题。

0

糟糕,我已经卸载了 NCrunch 并重启了电脑...问题仍然存在! - BanksySan
我以为我们解决了这个问题 - 我会保留我的评论,以便如果有其他人需要帮助的话。也许只需禁用扩展程序,直到您找到可能引发异常的内容为止。您还可以尝试在安全模式下使用VS https://msdn.microsoft.com/zh-cn/library/ms241278.aspx?f=255&MSPPError=-2147217396 - Amanda Lange
1
我刚刚也卸载了Reshaper,然后重新安装了它。目前看起来很好。如果它表现良好,我将重新安装NCrunch并查看是否只是一个有问题的安装。 - BanksySan

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接