Problems with test runner in VS 2019 w/ R# 2019.1

Answered

I am getting the following error when I try to run the tests for my project. This worked fine with previous releases of R#. If I close out of VS and re-open, I can get it to run once or twice, but then the error pops up again.

 

2019.05.01 17:48:56.654 TRACE Launch: 22127fa5-7dfe-4276-9eab-1b64e7077b5d >> RunHostController.AfterLaunchStarted
2019.05.01 17:48:56.654 TRACE Launch: 22127fa5-7dfe-4276-9eab-1b64e7077b5d << RunHostController.AfterLaunchStarted
2019.05.01 17:48:56.654 INFO BuildStage started
2019.05.01 17:48:56.654 INFO Build policy: Automatic
2019.05.01 17:48:56.657 ERROR System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary
at JetBrains.Util.DataStructures.CompactMapBase`4.get_Item(TKey key)
at JetBrains.ReSharper.UnitTestFramework.Caches.UnitTestElementIdToIdentityMap.GetBy(Int32 id)
at System.Linq.Enumerable.<>c__DisplayClass7_0`3.<CombineSelectors>b__0(TSource x)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Collections.Generic.JetHashSet`1..ctor(IEnumerable`1 enumerable, IEqualityComparer`1 comparer)
at System.Linq.EnumerableExJet.ToJetHashSet[TSource](IEnumerable`1 source)
at JetBrains.ReSharper.UnitTestFramework.Caches.UnitTestElementCache.CachedElements.GetOrQueryElements(UnitTestElementIdToIdentityMap uteIdToIdentityMap, Lazy`1 repository)
at JetBrains.ReSharper.UnitTestFramework.Caches.OneToOneLevelDbCache`1.GetBy(TKey key)
at JetBrains.ReSharper.UnitTestFramework.Criteria.ProjectCriterion.EvaluationOptimization.EvaluateCriterion(ProjectCriterion criterion)
at lambda_method(Closure , Object )
at JetBrains.ReSharper.UnitTestFramework.QueryProvider.OptimizationDefinition`1.SingleParam.TryFetch(Expression expression)
at JetBrains.ReSharper.UnitTestFramework.QueryProvider.QueryProvider`1.Evaluator.WhereEvaluator.Visit(Expression node)
at JetBrains.ReSharper.UnitTestFramework.QueryProvider.QueryProvider`1.Evaluator.WhereEvaluator.EvaluateAsSet(Expression expr)
at JetBrains.ReSharper.UnitTestFramework.QueryProvider.QueryProvider`1.Evaluator.WhereEvaluator.VisitBinary(BinaryExpression node)
at System.Linq.Expressions.BinaryExpression.Accept(ExpressionVisitor visitor)
at JetBrains.ReSharper.UnitTestFramework.QueryProvider.QueryProvider`1.Evaluator.WhereEvaluator.Visit(Expression node)
at JetBrains.ReSharper.UnitTestFramework.QueryProvider.QueryProvider`1.Evaluator.WhereEvaluator.EvaluateAsReadOnlySet(Expression expr)
at JetBrains.ReSharper.UnitTestFramework.QueryProvider.QueryProvider`1.Evaluator.VisitMethodCall(MethodCallExpression node)
at System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor visitor)
at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
at JetBrains.ReSharper.UnitTestFramework.QueryProvider.QueryProvider`1.Execute(Expression expr)
at JetBrains.ReSharper.UnitTestFramework.UnitTestElementRepository.LockingQueryProvider.Execute(Expression expr)
at JetBrains.ReSharper.UnitTestFramework.UnitTestElementRepository.LockingQuery`1.GetEnumerator()
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.Util.CollectionUtil.AsSet[T](IEnumerable`1 enumerable)
at JetBrains.ReSharper.UnitTestFramework.Launch.Stages.BuildStage.CollectProjectsToBuild()
at JetBrains.ReSharper.UnitTestFramework.Launch.Stages.BuildStage.Run(CancellationToken onCancel, CancellationToken onAbort)
at JetBrains.ReSharper.UnitTestFramework.Launch.UnitTestLaunch.<RunStage>d__71.MoveNext()
2019.05.01 17:48:56.657 INFO FinishLaunchStage started
2019.05.01 17:48:56.657 INFO Finishing launch
2019.05.01 17:48:56.812 INFO Launch is finished
2019.05.01 17:48:56.813 INFO FinishLaunchStage completed
2019.05.01 17:48:56.821 TRACE Launch: 22127fa5-7dfe-4276-9eab-1b64e7077b5d >> RunHostController.BeforeLaunchFinished
2019.05.01 17:48:56.821 TRACE Launch: 22127fa5-7dfe-4276-9eab-1b64e7077b5d << RunHostController.BeforeLaunchFinished

5
4 comments

I have started getting exactly the same exception with the same stacktrace today after updating Resharper Ultimate. I am using MSTest with .NET Core 2.2.

1

Same problem here. R# 2019.1 gives same stack trace as above in both VS 2017 (15.9.11) and VS 2019 (16.0.3). 

0

Hello everyone!

We’ve released new version containing fix of this problem, you are welcome to try it - https://www.jetbrains.com/resharper/download/.
Please accept apologies for inconvenience.

2

I can confirm that this works! VS notified me of the update. I have not had any issues since picking that up.

0

Please sign in to leave a comment.