Does anyone know why Visual Studio can't set a breakpoint after the update?

Viewed 1020

I upgraded the version from 2019 to 2022; enter image description here

But this action caused a problem: I cannot insert breakpoint anymore (.cshtml file),other formats can still insert breakpoints. enter image description here

enter image description here

I tried to modify the debug settings, failed. I don't know the reason, so can anyone tell me the reason? I am sure the code has no problem, is it the reason for the version 2022?

1 Answers

I found a workaround: Instead of inline code like this:

@Html.Raw(Model.template.Css)

Try to refactor like this:

@{
    Html.Raw(Model.projectCss);
}

You can then place the breakpoint on the line in the middle.

Related