Razor icon indicating copy to clipboard operation
Razor copied to clipboard

Since upgrading to RC2, I am unable to set a breakpoint in my Razor view.

Open 82dsoldier opened this issue 10 years ago • 18 comments

Title says it all. When attempting to set a breakpoint in a Razor view, I get the message:

"The following breakpoint cannot be set:

At Index.cshtml, line 11 character 5 ('Asp._Page_Views_Applications_Index_cshtml.ExecuteAsync()')

The breakpoint failed to bind."

82dsoldier avatar Jun 01 '16 11:06 82dsoldier

@Tratcher did you encounter anything like this when verifying Razor debugging?

NTaylorMullen avatar Jun 01 '16 17:06 NTaylorMullen

No, it worked for me.

Tratcher avatar Jun 01 '16 17:06 Tratcher

@82dsoldier could you push a small repro project somewhere for me to take a look?

NTaylorMullen avatar Jun 01 '16 17:06 NTaylorMullen

I'd love to, but I can't seem to reproduce it in a small project. I have two major projects and it's broken in both, but I can't upload them anywhere due to security issues. Anything I could look at to see what's causing the issue?

82dsoldier avatar Jun 01 '16 20:06 82dsoldier

@ToddGrun are there steps @82dsoldier can take to diagnose Razor breakpoint setting issues since he's unable to upload a repro project for us to peak at?

NTaylorMullen avatar Jun 01 '16 21:06 NTaylorMullen

Just to clarify, this isn't when setting the breakpoint at design time, but rather when binding the breakpoint when running the application, right? Is this for a .NET core web app, an MVC app or something else?

ToddGrun avatar Jun 03 '16 18:06 ToddGrun

@pranavkm could this be related to https://github.com/aspnet/Diagnostics/issues/293 ?

Eilon avatar Jun 04 '16 16:06 Eilon

@ToddGrun correct, it is setting the breakpoint when running the app. If I try to set the breakpoint before running the app, it sets correctly but is never hit. It is for an MVC application.

82dsoldier avatar Jun 06 '16 13:06 82dsoldier

I tried this on apps targeting both net451 and netcoreapp1.0 and I couldn't reproduce the issue:

animation

Could you let us know what the Symbol Status is in the Modules window (Debug -> Windows -> Modules). View assemblies have random file names so they'd be easy to spot.

pranavkm avatar Jun 10 '16 00:06 pranavkm

For my app, the status is "Symbols loaded." I only have two modules listed that have random names and both of them list "Symbols loaded" as well.

82dsoldier avatar Jun 13 '16 19:06 82dsoldier

I have similar issue. Reproduced on new project with default template.

screenshot 2016-06-14 12 21 04 2

screenshot 2016-06-14 12 19 06

t0xicDen avatar Jun 14 '16 09:06 t0xicDen

@t0xicDen could you push the app to a repo? Let me try it out to see if it's a code issue. In the meanwhile, I'd recommend trying to repair VS (via Programs & Features). I haven't been able to reproduce the error locally so it might be an installation issue.

@82dsoldier do your two projects contain any pre-RC references?

pranavkm avatar Jun 14 '16 16:06 pranavkm

I don't see any pre-RC references.

Strange thing. Due to another issue, I rebuilt my Index.cshtml page. Now I can set breakpoints and they are actually hit, but when I attempt to do a quick watch on any variable I get the message that it isn't defined in the current scope.

82dsoldier avatar Jun 14 '16 17:06 82dsoldier

cc @BillHiebert any guesses on what could be wrong here?

pranavkm avatar Jun 14 '16 17:06 pranavkm

@pranavkm https://github.com/t0xicDen/RazorIssue772 app repo

t0xicDen avatar Jun 15 '16 09:06 t0xicDen

@t0xicDen I'm not seeing this issue. I tried this on different machines and it was working just fine. I'd recommend repairing or reinstalling VS.

@82dsoldier, if you're still experiencing issues with the watch window, I'd recommend trying a VS repair. If you continue seeing it, please file a bug in the https://github.com/aspnet/Tooling repo.

pranavkm avatar Jun 16 '16 16:06 pranavkm

@pranavkm by the way, i am using VS 2015 Enterprise 2015 Version 14.0.25402.00 Update 3 RC

t0xicDen avatar Jun 17 '16 08:06 t0xicDen

The new Update for Microsoft Visual Studio 2015 Update 3 (KB3165756) has fixed the breakpoint issue for me where I'm trying to inspect the local variables in C# code embedded in cshtml files in ASP.NET Core applications.

hemantkd avatar Aug 01 '16 11:08 hemantkd