Kirsten
Kirsten

Reputation: 18066

unexpected error detected. Check the Tests Output Pane for details (Resharper stops build)

If I suspend Resharper my build works. However with Resharper on I get the following message when I build.

unexpected error detected. Check the Tests Output Pane for details 

The Tests Output Pane shows

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

t

Upvotes: 2

Views: 3964

Answers (4)

yogihosting
yogihosting

Reputation: 6292

In my case I have to install the following 2 package to my Test project. (I already had xunit package installed)

Microsoft.NET.Test.Sdk
xunit.runner.visualstudio

Upvotes: 0

GrayDwarf
GrayDwarf

Reputation: 2737

This happened to me in Visual Studio 2017 with Resharper 2019.1.3. Restarting Visual Studio resolves the issue so you can at least continue working.

Upvotes: 0

Bill Tarbell
Bill Tarbell

Reputation: 5234

If your version of resharper is not able to update to 2018.1 then another option is to simply suspend Resharper to allow compilation to succeed. After everything is built you can then re-enable resharper and run your unit tests without issue.

You can disable resharper by going to the Tools menu and choosing Options. Scroll down and select Resharper -> General. Click the 'Suspend Now' button. Once the build succeeds you can click the Resume button.

Upvotes: 0

Alexander Kurakin
Alexander Kurakin

Reputation: 13523

The same issue was fixed in ReSharper 2018.1 build.

Upvotes: 2

Related Questions