如何在Visual Studio 2010的"输出"窗口中读取Console.WriteLine()的结果

fre*_*ing 2 asp.net console.writeline visual-studio-2010

简单来说,我只需在Web应用程序中添加一行:

    void Application_Start(object sender, EventArgs e)
    {
        // Code that runs on application startup
        Console.WriteLine("Hello, world!");
    }
Run Code Online (Sandbox Code Playgroud)

我想要的是读"Hello,world!" 在Visual Studio 2010的输出窗口上,但失败了,有什么不对?

在此输入图像描述

我尝试过:通过工具>选项>项目和解决方案>构建和运行来更改详细程度,并更改"MSBuild项目构建输出详细程度"的值,但没有任何影响.

Ode*_*ded 10

如果要在"调试"窗口中查看结果,请使用Debug.WriteLine而不是Console.WriteLine.

using System.Diagnostics;

void Application_Start(object sender, EventArgs e)
{
    Debug.WriteLine("Hello, world!");
}
Run Code Online (Sandbox Code Playgroud)