How to use Console.WriteLine in ASP.NET (C#) during debug?

后端 未结 7 2250
说谎
说谎 2020-12-22 21:40

I want to write some result to the console in ASP.NET (C#). It works in a Window application, but a Web application does not work. Here is what I have tried:



        
7条回答
  •  甜味超标
    2020-12-22 22:06

    Trace.Write("Error Message") and Trace.Warn("Error Message") are the methods to use in web, need to decorate the page header trace=true and in config file to hide the error message text to go to end-user and so as to stay in iis itself for programmer debug.

提交回复
热议问题