Do you have a way to run this code without NCrunch, and if so, can you confirm 100% whether the behaviour is different under NCrunch?
I've tried constructing a code sample using the lines you've shared, but I can't seem to get this to fail in the same way ... is there any chance you can reproduce this in a code sample you can share with me?
Sorry, no fix is available yet for the async local variables issue.
We're working on it. This is in quite a complex area of the product, and right now we're also very busy with .NET Core 3.0 issues, which are a higher priority as they don't have a workaround.
If this issue is causing problems for you, it's possible to work around it by just switching back to the Legacy instrumentation mode. You can also force the compiler to build a non-portable PDB (which will also work around the issue), by adding a 'Custom build property' of 'DebugType' to 'full' in your NCrunch configuration.
For anyone having issues resolving variables in async methods, would you be interested in trying the build below? It contains a targeted fix for this problem. It would be great if you could confirm whether this solves the issue for you.
I totally missed your post with version 4.2.0.5. I just came here to work out a reproduction today, but with 4.2.0.7 this issue is still the same. I'm currently working on a reproduction, but this will have some production code. When I have a small repro, can I share it with you in a private way?
Advisto wrote:I totally missed your post with version 4.2.0.5. I just came here to work out a reproduction today, but with 4.2.0.7 this issue is still the same. I'm currently working on a reproduction, but this will have some production code. When I have a small repro, can I share it with you in a private way?
Thanks for your willingness to create a sample! You can send them privately via the contact form or via email.
Advisto wrote:I totally missed your post with version 4.2.0.5. I just came here to work out a reproduction today, but with 4.2.0.7 this issue is still the same. I'm currently working on a reproduction, but this will have some production code. When I have a small repro, can I share it with you in a private way?
Thanks for your willingness to create a sample! You can send them privately via the contact form or via email.
I've just submitted my reproduction via the contact form.
Thanks again for sending through the sample to reproduce this issue. I appreciate that this must have been difficult to create - the problem was related to the size of the assembly. Would you be interested in trying the build below? I'm hopeful that this should solve the issue.
To reproduce I've taken a copy of my productioncode and cut all non-relevant parts away. But indeed, it took some time to create.
Interesting that the assemblysize was relevant, because the reproduction was much smaller than the original. I did just delete code and after each delete check if the problem still existed.
Thanx, in this build the problem is fixed! And I'm happy to be able to use the optimized mode from now on :)