This project is read-only.

How can I debug precompiled razor views?

Jul 9, 2011 at 5:57 PM

I have noticed one flaw with the precompiled razor views.  My view has an if->else if->else logic in it but my else if isn't getting triggered.  Usually I would set a breakpoint at the else if to see why my condition isn't being met even though I think it should be, but when I set a breakpoint both in the cshtml file as well as the generated .cs file they never get hit.

Is there any way to actually debug a precompiled view?

Jul 9, 2011 at 5:59 PM

Nevermind, I had my logic flipped around and my breakpoint wasn't getting hit because my logic was short circuiting before that.  User error :)

Jul 9, 2011 at 11:58 PM

Yep, should work. One annoying thing is that the generated view has a hard coded line pragma to the cshtml file, which means if another dev changes it all the paths might change. We're trying to find a way around this by using a relative path instead.