为了简单起见,我只在 Web 应用程序中添加一行:
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
Console.WriteLine("Hello, world!");
}
我想要的是阅读“Hello, world!”在 Visual Studio 2010 的输出窗口上,但失败了,怎么了?
我试过: 通过“工具”>“选项”>“项目和解决方案”>“构建和运行”更改详细程度,并更改“MSBuild 项目构建输出详细程度”的值 但没有任何效果。
最佳答案
使用Debug.WriteLine
如果您想在调试窗口中查看结果,请代替 Console.WriteLine
。
using System.Diagnostics;
void Application_Start(object sender, EventArgs e)
{
Debug.WriteLine("Hello, world!");
}
关于asp.net - 如何在 Visual Studio 2010 的输出窗口中读取 Console.WriteLine() 的结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8228466/