Getting Trace messages into Failed Request Tracing from Controllers
问题 On ASP.NET MVC Preview 5, we're having trouble getting any trace messages from Global or Controllers to appear in either a page (View) or Failed Request Tracing (FREB). Neither of these calls work in a Controller Action: HttpContext.Trace.Write("hello"); System.Diagnostics.Trace.WriteLine("world"); There are no issues with trace statements in a Page's code-behind; those messages appear correctly. 回答1: Those calls happen before the Page (ViewPage) is even created so you need to enable tracing