I am trying to debug a Razor helper function which is running locally on IIS.
Even when my helper code reads:
System.Diagnostics.Debugger.Break();
The breakpoint does not occur.
So I think it is because IIS fails to compile the function in debug mode.
I added this in web.config but it doesn't solve the issue:
<compilation debug="true"></compilation>
Surely somebody else has run into this, or is just my particular laptop buggy???
Thanks! - Brian
I figured it out, man what a wild goose chase!
I forgot the "@" symbol when calling the helper. My code looked like this:
MyHelper()
But it should look like this:
@MyHelper()
It seems in this case Razor doesn't even CALL the function, or perhaps calls it but with debug mode off, anyway I added the "@" symbol and then could trace in with the debugger again.
Seems lots of little pitfalls like that, with this Razor thingee...
Hope that helps somebody avoid losing 2 hours of their day. :-(
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With