C# 如何记录消息以便在VS2013中查看?
我正在本地运行VS2013 Azure应用程序,并向调试窗口输出一条消息,如下所示:C# 如何记录消息以便在VS2013中查看?,c#,asp.net,visual-studio,C#,Asp.net,Visual Studio,我正在本地运行VS2013 Azure应用程序,并向调试窗口输出一条消息,如下所示: Debug.WriteLine(logString); 这种方法有时有效,有时我会收到一条信息说: Not running in a hosted service or the Development Fabric. Could not create Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft
Debug.WriteLine(logString);
这种方法有时有效,有时我会收到一条信息说:
Not running in a hosted service or the Development Fabric.
Could not create Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics,
根据我从其他答案中了解到的情况,所以当我使用Debug.Write()时,与诊断存在某种冲突
那么,是否有其他方法可以在测试时将消息写入输出窗口?我知道有一个控制台。写,但这不会工作,因为我没有控制台 使用System.Diagnostics,您可以使用跟踪对象:
Trace.Write("YOUR MESSGE");
这里有一个参考…请确保将云服务项目设置为启动项目,而不是将任何角色项目设置为启动项目,或引用此相关SO。跟踪输出将转到哪里?如何查看?在visual Studio的输出窗口上,按Ctrl+Alt+O组合键以显示它