dotnet/roslyn

Debugger stepping out of async ValueTask method simply continues execution of program

Ouverte

#36 240 ouverte le 7 juin 2019

 (0 commentaire) (0 réaction) (0 personne assignée)C# (4 257 forks)batch import
Area-InteractiveBugDeveloper CommunityInteractive-Debugginghelp wanted

Métriques du dépôt

Stars
 (20 414 étoiles)
Métriques de merge PR
 (Merge moyen 6j 17h) (256 PRs mergées en 30 j)

Description

VSF_TYPE_MARKDOWN1. Create a .NET (Core) console application with the code below.

  1. Hit F11 to begin stepping into the program.
  2. Continue pressing F11 till the program exits.

Expected Each statement and closing curly brace is stepped to.

Actual At the exiting curly brace of the async ValueTask method, Step Into simply Runs the rest of the program instead of stepping back to the 2 calling methods.

using System;
using System.Threading.Tasks;

namespace StepIntoRepro
{
    class Program
    {
        static void Main(string[] args)
        {
            StepIntoValueTaskMethod(). Wait();
        }

public static async Task StepIntoValueTaskMethod()
        {
            await DoValueTask(false);
        }

private static async ValueTask DoValueTask(bool yield)
        {
            if (!yield)
            {
                return;
            }

await Task.Yield();
        }
    }
}

This issue has been moved from https://developercommunity.visualstudio.com/content/problem/591002/debugger-stepping-out-of-async-valuetask-method-si.html VSTS ticketId: 903574 These are the original issue comments:

Visual Studio Feedback System on 6/3/2019, 02:28 AM (4 days ago): We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

These are the original issue solutions: (no solutions)

Guide contributeur