dotnet/roslyn

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

開放

#36,240 建立於 2019年6月7日

 (0 則留言) (0 個反應) (0 位負責人)C# (4,257 個分叉)batch import
Area-InteractiveBugDeveloper CommunityInteractive-Debugginghelp wanted

倉庫指標

星標
 (20,414 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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)

貢獻者指南