使用ASP.NET建立网站,一般一个F5键就直接跳到浏览器页面了;如果想要调试的话,直接用Console.WriteLine() 打印出各种信息行不行呢?回到Visual Studio下,我不知道哪里能看到Console输出的信息。
用 System.Diagnostics.Debug.WriteLine(...) 代替 Console.WriteLine(..) 是个很好的选择。然后在菜单栏选择 View -> Output 就能在运行网站的同时看到打印出的各种信息了。
System.Diagnostics.Debug.WriteLine(...)