How to debug Sitefinity MVC Widget

719 Views Asked by At

I am trying to debug a MVC widget in sitefinity 8 but the debugger doesn't hit the breakpoint. The widget works but I cannot debug it. What is wrong? It seems like sitefinity compiles the widget first then renders the compiled one at run time. Am I right? How can I get to breakpoint?

Edit:

The debugger actually hit the breakpoint if the code is inside controller. But I cannot debug into view's (cshtml file) code.

2

There are 2 best solutions below

0
On

He Behrooz,

you can turn off the Caching for the page you drag widget:

Page -> click on "Action" -> "Titles and Properties" -> scroll down to "Advance Tab" -> add choose Caching Options is "No Caching".

You can see the image attachment for more details.

1
On

Sitefinity is caching your views. If you want to debug the view, make sure to let the breakpoint hit it the very first time.