开发者

Trace.Warn doesn't output trace messages in MVC

开发者 https://www.devze.com 2023-02-28 23:33 出处:网络
It开发者_C百科 doesn\'t seem to work like it did in ASP.NET webforms? Any ideas?That\'s normal, Trace no longer works in ASP.NET MVC as it did in classic WebForms. You may checkout Glimpse instead whi

It开发者_C百科 doesn't seem to work like it did in ASP.NET webforms? Any ideas?


That's normal, Trace no longer works in ASP.NET MVC as it did in classic WebForms. You may checkout Glimpse instead which provides similar and additional functionalities.


While it doesn't work in exactly the same way as in Web Forms, Tracing still works to some extent in MVC. You just don't get the page output. You can still enable tracing in the web.config and use HttpContext.Trace.Write and HttpContext.Trace.Warn. You can get to the results by requesting Trace.axd, although it doesn't appear to want to work in Views, but then you wouldn't have logic you want to track there anyway...

I would agree that Glimpse is a strong tool.

0

精彩评论

暂无评论...
验证码 换一张
取 消