Closed
Description
Describe the bug
Pressing F10 (Step Over) when debugging a WASM project doesn't always step over the current expression. This can be frustrating when debugging because the STEP OVER command acts unpredictably
To Reproduce
- Create a new Blazor WASM project
- Add a new .NET library project to the solution
- Add the
Foo
class to the library with the code below - Add a reference to the .NET library project from the WASM project
- Update the
FetchData.razor
page with the code below. - Add a breakpoint in the
Bar
method of theFoo
class wherevar d
is defined. - Start debugging
- Click on the "Fetch Data" link in the window
- The program should break on the breakpoint added in step 6
- Press F10 (or otherwise select STEP OVER in VS)
Expected Results
The current executing line of code should progress to the following line with Console.WriteLine
Actual Results
The current executing line of code remains on the current line and requires a second press to continue as expected.
Notes
This only appears to affect code in referenced assemblies. If the body of Bar
is copied to OnInitializedAsync
, STEP OVER behaves as expected. Upon deeper investigation, it appears that the operands of &&
are being treated as separate lines of code when debugged from the referenced library.
Foo Class
public class Foo
{
public void Bar()
{
var a = 1;
var b = 2;
var x = "Stew";
var y = "00.123";
var c = a + b == 3 || b + a == 2;
var d = TimeSpan.TryParseExact(y, @"ss\.fff", null, out var ts) && x.Contains('S');
Console.WriteLine(d);
}
FetchData.razor
protected override async Task OnInitializedAsync()
{
new BlazorBugsLib.Foo().Bart();
forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("Bad URI");
}