Visual Studio 2022 - how to to Use Conditional Breakpoints with Async Methods
I've hit a wall trying to This might be a silly question, but I'm having trouble using conditional breakpoints in Visual Studio 2022 while debugging an asynchronous method. I set a breakpoint in an `async` method to inspect a variable's value when it reaches a certain condition. However, the breakpoint is never hit, and I don't see any errors or warnings in the output window. I tried placing the breakpoint directly on the `await` statement, but it seems that the debugger skips over it without executing the condition. Here's a simplified version of my code: ```csharp public async Task<string> GetDataAsync(int id) { var result = await SomeApiCallAsync(id); return result; } private async void SomeMethod() { var data = await GetDataAsync(1); } ``` I set a conditional breakpoint on `var result = await SomeApiCallAsync(id);` with the condition `id == 1`. In previous versions of Visual Studio, this worked without any issues, but in this version, it just doesn't seem to trigger. I've also tried cleaning and rebuilding the solution, and even restarting Visual Studio, but nothing seems to work. Does anyone have any insights into why conditional breakpoints might not be functioning correctly with async methods in Visual Studio 2022? Are there any specific settings or configurations I should check? Thanks in advance! For reference, this is a production CLI tool. What am I doing wrong? I've been using Csharp for about a year now.