Provide Debugging Support for Async/Await Methods
Posted in response to: http://forum.ncrunch.net/yaf_postsm5589_does-not-exist-in-the-current-context.aspx#post5589
It seems there are technical issues that limit the debugging experience of async/await methods when using NCrunch. Essentially the auto's, local's, and watch windows in visual studio cease to function properly when debugging async/await code when using NCrunch. Ideally, such technical issues could be overcome, but if that is not possible, the following would suffice:
Add a debugging mode in NCrunch that does not add NCrunch instrumentation to the code. This would allow new debugging options such as 'Debug covering tests without instrumentation' and 'Break into first covering test without instrumentation'. This would allow the option of a proper debugging experience when the need to debug async/await methods arises.
Currently I workaround this issue by utilizing another unit test runner such as Resharper's or Visual Studio's unit test runner when I need to debug async/await code.
This issue should now be resolved in the new v2.11 release. You should now have local debugging data available in async/iterator methods with NCrunch instrumentation enabled.
This still seems to be an issue for me. I'm using v220.127.116.11
Still an issue in 2.10 builds, have to use Resharper / standard Visual Studio's runners.
I can confirm that it has not fixed the issue with iterator blocks.
Thanks for trying to fix this issue, though!
Awesome... thanks this is really helpful.
You can make your test methods non async and add .Wait() or .Result() to every await-able method call.
its annoying but it helps some.
Jeff Pinkham commented
Yep it's a total pain. I end up having to use Resharper's test runner.. and if I wanted to do that I wouldn't have bought ncrunch..
ALL of my code is async awaited as I mainly build APIs for mobile and web clients. Rendering Ncrunch useless in debugging scenarios.