Visual studio 检测到意外错误。检查测试输出窗格以了解详细信息(Resharper停止生成)
如果我挂起Resharper,我的构建就会工作。 然而,使用Resharper,我在构建时得到以下消息Visual studio 检测到意外错误。检查测试输出窗格以了解详细信息(Resharper停止生成),visual-studio,resharper,Visual Studio,Resharper,如果我挂起Resharper,我的构建就会工作。 然而,使用Resharper,我在构建时得到以下消息 unexpected error detected. Check the Tests Output Pane for details 测试输出窗格显示 2/07/2018 10:53:31 AM Informational] ------ Discover test started ------ [2/07/2018 10:53:32 AM Informational] =========
unexpected error detected. Check the Tests Output Pane for details
测试输出窗格显示
2/07/2018 10:53:31 AM Informational] ------ Discover test started ------
[2/07/2018 10:53:32 AM Informational] ========== Discover test finished: 18 found (0:00:01.692) ==========
[2/07/2018 10:54:24 AM Error] System.MissingMethodException: Method not found: 'Microsoft.VisualStudio.TestWindow.Extensibility.ITestContainer Microsoft.VisualStudio.TestWindow.Controller.ITestContainerProvider.FindTestContainer(System.String, System.Uri)'.
at JetBrains.ReSharper.UnitTestProvider.MSTest11.New.JetDiscoveryOperation.<GetTestContainersFor>d__21.MoveNext()
at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at System.Collections.Generic.HashSet`1.UnionWith(IEnumerable`1 other)
at System.Collections.Generic.HashSet`1..ctor(IEnumerable`1 collection, IEqualityComparer`1 comparer)
at System.Collections.Generic.HashSet`1..ctor(IEnumerable`1 collection)
at System.Linq.EnumerableExJet.ToSet[TSource](IEnumerable`1 source)
at JetBrains.ReSharper.UnitTestProvider.MSTest11.New.JetDiscoveryOperation.GetTestContainers(IEnumerable`1 sources)
at JetBrains.ReSharper.UnitTestProvider.MSTest11.New.JetDiscoveryOperation.GeTestContainersAndRetry(IEnumerable`1 sources)
at JetBrains.ReSharper.UnitTestProvider.MSTest11.New.JetDiscoveryOperation.ExecuteInternalCore()
at JetBrains.ReSharper.UnitTestProvider.MSTest11.New.JetDiscoveryOperation.<ExecuteInternal>b__6()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.TestWindow.Controller.Operation.<ExecuteWithEvents>d__40.MoveNext()
[2/07/2018 10:54:24 AM Informational] ------ Discover test started ------
[2/07/2018 10:54:25 AM Informational] ========== Discover test finished: 18 found (0:00:00.595) ==========
2/07/2018 10:53:31 AM信息性]----发现测试已开始------
[2018年7月2日上午10:53:32信息性]=========发现测试已完成:发现18个(0:00:01.692)==========
[2/07/2018 10:54:24 AM错误]System.MissingMethodException:找不到方法:“Microsoft.VisualStudio.TestWindow.Extensibility.ITestContainer Microsoft.VisualStudio.TestWindow.Controller.ITestContainerProvider.FindTestContainer(System.String,System.Uri)”。
在JetBrains.ReSharper.UnitTestProvider.MSTest11.New.jetdiscoveryooperation.d_u21.MoveNext()中
在System.Linq.Enumerable.d_u17`2.MoveNext()中
位于System.Linq.Enumerable.WhereEnumerableInterator`1.MoveNext()
at System.Collections.Generic.HashSet`1.UnionWith(IEnumerable`1其他)
位于System.Collections.Generic.HashSet`1..ctor(IEnumerable`1集合,IEqualityComparer`1比较器)
位于System.Collections.Generic.HashSet`1..ctor(IEnumerable`1集合)
位于System.Linq.EnumerableExJet.ToSet[TSource](IEnumerable`1 source)
在JetBrains.ReSharper.UnitTestProvider.MSTest11.New.jetdiscoveryooperation.GetTestContainers(IEnumerable`1源代码)
在JetBrains.ReSharper.UnitTestProvider.MSTest11.New.JetDiscoveryOperation.GetTestContainerAndRetry(IEnumerable`1来源)
位于JetBrains.ReSharper.UnitTestProvider.MSTest11.New.jetdiscoveryooperation.ExecuteInternalCore()
位于JetBrains.ReSharper.UnitTestProvider.MSTest11.New.jetdiscoveryooperation.b_u6()
---来自引发异常的上一个位置的堆栈结束跟踪---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)
在System.Runtime.CompilerServices.TaskWaiter.HandleNonSuccessAndDebuggerNotification(任务任务)中
在Microsoft.VisualStudio.TestWindow.Controller.Operation.d_u40.MoveNext()中
[2/07/2018 10:54:24 AM信息]----发现测试开始------
[2018年7月2日上午10:54:25信息性]=========发现测试完成:发现18个(0:00:00.595)==========
t在ReSharper 2018.1版本中已修复。如果您的ReSharper版本无法更新到2018.1,则另一个选项是简单地挂起ReSharper以允许编译成功。在构建完所有内容之后,您可以重新启用resharper并运行单元测试,而不会出现问题
您可以通过转到“工具”菜单并选择“选项”来禁用resharper。向下滚动并选择Resharper->General。单击“立即挂起”按钮。构建成功后,您可以单击“恢复”按钮。我在Visual Studio 2017中使用Resharper 2019.1.3时遇到过这种情况。重新启动Visual Studio可以解决此问题,因此您至少可以继续工作。在我的情况下,我必须将以下2个软件包安装到我的测试项目中。(我已经安装了xunit软件包)
奇怪的是,我在另一台机器上没有发现这个错误你在有问题的机器上使用的是什么ReSharper版本?类似的例外情况在R#2018.1版本中得到了解决
Microsoft.NET.Test.Sdk
xunit.runner.visualstudio