Skip to content

Blazor 6 WebAssembly System.Diagnostics.Debugger.Break(); sets current line wrong #56191

@vsfeedback

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


See sample program. When you run the program it will stop but it puts the Next Line to be executed wrong. See screen shot and sample application.

To recreate:

  1. Run application
  2. Click on Counter
  3. Click on Button

The cursor will be on the wrong statement


Original Comments

Feedback Bot on 7/19/2021, 02:13 AM:

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.


Original Solutions

(no solutions)

Sample program:

@page "/counter"

<h1>Counter</h1>

<p role="status">Current count: @currentCount</p>

<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>

@code {
    private int currentCount = 0;

    private void IncrementCount()
    {
        currentCount++;
        try {
            throw new InvalidOperationException();
        } catch (Exception e)
        {
            Test(e);
        }
    }

    private void Test(Exception exception)
    {
        var st = exception.StackTrace;
        System.Diagnostics.Debugger.Break();
    }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions