dotnet/roslyn

Strange behaviour in async method

Offen

#32.276 geöffnet am 09.01.2019

 (5 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C# (4.257 Forks)batch import
Area-InteractiveBugDeveloper CommunityInteractive-Debugginghelp wanted

Repository-Metriken

Stars
 (20.414 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 6T 17h) (256 gemergte PRs in 30 T)

Beschreibung

I have a solution targeting NetCoreApp2.0.

Lately I've seen that when running an async method, the debugger shows me variables that are non allocated (out of scope).

If this variable is an IQueryable<string> it will show show up in the 'Locals window' as NullReferenceException.

If I manually set the 'next statement' to first statement in the block containing this IQueryable<string>, a NullReferenceException will be thrown when accessing the variable.

This issue has been moved from https://developercommunity.visualstudio.com/content/problem/238451/strange-behaviour-in-async-method.html VSTS ticketId: 604787 These are the original issue comments: (no comments) These are the original issue solutions: (no solutions)

Contributor Guide