在过去,或许现在使用的2008年之前的Visual Studio版本,我会在VB.NET代码中做这样的事情:
In the past, perhaps versions of Visual Studio prior to the 2008 that I am using now, I would do something like this in my VB.NET code:
System.Diagnostics.Debug.WriteLine("Message")..并且输出将转到输出窗口。
..and the output would go to the output window.
现在没有。必须首先显示某些东西。
Now it doesn't. Something must first apparently be enabled.
如果这涉及到附加调试器,请说明如何做。在我看来,它应该没有太大的惊喜。
If this involves "attaching a debugger", please explain how to do it. It seems to me that it should just work without too much of a fuss.
这是一个实时解释问题的视频,并显示所有我的设置:
Here's a video explaining the issue in real time and showing you all my settings:
screencast/t/YQnPb0mJcs
我正在使用Visual Studio 2008。
I'm using VisualStudio2008.
推荐答案所有好的建议我注意到我没有看到这个提示,所以我会说:在你的app.config文件中,确保你没有一个< clear /> 元素。
All good suggestions. I noticed that I don't see this tip mentioned, so I'll say it: In your app.config file, make sure you don't have a <clear/> element in your trace listeners.
您将有效地清除跟踪侦听器的列表,包括默认的跟踪侦听器用于调试语句。
You will effectively be clearing the list of trace listeners, including the default trace listener used for Debug statements.
这是您的app.config文件中的内容:
Here's what this would look like in your app.config file:
<system.diagnostics> <trace> <listeners> <!-- This next line is the troublemaker. It looks so innocent --> <clear/> </listeners> </trace> </system.diagnostics>如果你想在你的app.config文件中有跟踪监听器的占位符,你应该改用如下所示:
If you want to have a placeholder for trace listeners in your app.config file, you should instead use something like this:
<system.diagnostics> <trace> <listeners> </listeners> </trace> </system.diagnostics>更多推荐
Debug.WriteLine不工作
发布评论