Skip to content

[browser][debugger] Cannot set breakpoint in partial class defined in separate files #96734

Open
@ilonatommy

Description

@ilonatommy

Discovered in #96497.
Using debugger-test.cs we are setting a bp in the constructor:

namespace DebuggerBreakpointTests
{
    public partial class BreakpointTestsClass
    {
        public BreakpointTestsClass()
        {
            int localVar = 123;
        }
    }

    public class CreateGoodBreakpointAtTheEndOfFileAndHit
    {
        public static void Run()
        {
            BreakpointTestsClass bpTest = new();
        }
    }
}

It works fine:

"locations": [
    {
      "scriptId": "dotnet://1_1",
      "lineNumber": 1667,
      "columnNumber": 8
    }
  ]

....as long as we don't have another part of BreakpointTestsClass in some different file (same file is fine). When we paste e.g.

namespace DebuggerBreakpointTests
{
    public partial class BreakpointTestsClass2
    {
        // Variables with initializers defined in a different file
        public int variable1 = 10;
        public string variable2 = "Hello";
    }
}

into debugger-test2.cs the same action finishes with returning empty breakpoint location by SetBreakpoint function.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions