简体   繁体   中英

Unit Test Sessions failed to execute

I'm using VS2015 professional with resharper ultimate and I've started to get the following error in the unit test session window when I'm executing my unit tests.

2016.09.21 14:16:54.745 ERROR System.AggregateException: One or more errors occurred. ---> System.Threading.Tasks.TaskCanceledException: A task was canceled. --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at JetBrains.ReSharper.UnitTestFramework.Launch.Stages.DiscoveryStage.Run(CancellationToken token) at JetBrains.ReSharper.UnitTestFramework.Launch.UnitTestLaunch.RunStage(Object stageObject) ---> (Inner Exception #0) System.Threading.Tasks.TaskCanceledException: A task was canceled.<---

tests of other projects works perfectly in VS2013 but not in VS2015. Yesterday I've installed couple of packages on my pc: vs14-kb3165756.exe and OpenCover.UI.vsix

I've tried to uninstall the OpenCover package which didn't solved the issue.

For anyone experiencing this issue, after re-adding a UWP Unit Test project multiple times, I found that after I created the new Unit Test Project (Universal Windows), in the Solution's Configuration Manager, for some reason the Build CheckBox was unchecked, and when I checked it, and ran my unit tests, all was executing as expected.

Right Click Solution > Configuration Manager...

I just had same issue, in my case solution configuration was set to "Release". Make sure all your project set to "Debug" and re-try. Worked for me

This is most probably related katit 's answer, but it also happens when the configuration is in Debug Mode, but a deployment using Release version is performed.

Runner fails to run after a deployment (Release) is performed, probably because it tries to run using the latest build output which is composed of Release assemblies (optimized), so a full rebuild with Debug configuration must be performed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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