是否可以在 Razor 模板中设置断点?
是否可以在 Razor 模板中设置断点?有人可能会争辩说,模板的逻辑应该如此“愚蠢”或“最小”,以至于您永远不必调试它们——这可能是有效的。然而,我认为 Razor 中没有任何东西可以防止模板以某种方式被滥用,因此最终可能需要对模板进行调试。
Is it possible to set a break point in a Razor template? One might argue that a template should be so "dumb" or "minimal" in it's logic that you should never have to debug them -- which might be valid. However, I don't think there is anything in Razor to prevent templates from being abused in some fashion, so eventually a template might need to be dubugged.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您确实可以在 Razor 模板中设置断点。无论您的视图多么“愚蠢”,它都会不可避免地(如果有用的话)用您可以根据需要调试的值填充视图。喜欢 ASP.NET MVC 的另一个原因。
You can indeed set a break point in a Razor template. And regardless of the "dumbness" of your view, it will unavoidably, if usefully, populate the view with values which you can debug as needed. Another reason to love you some ASP.NET MVC.
是的,这是可能的。
只要调试器连接到网站,它就可以工作。
Yes, it's possible.
As long as the debugger is attached to the website, that will just work.