简体   繁体   English

使用Debug.WriteLine写入Output窗口(VS2012)

[英]Using Debug.WriteLine to write to Output window (VS2012)

I've used a good part of yesterday reading through all the related posts on SO and other online forums to find a solution to this seemingly very straightforward problem that is driving me nuts. 昨天我用了很多篇幅来阅读SO和其他在线论坛上的所有相关帖子,找到解决这个看似非常简单的问题的方法,这让我疯狂。

For some reason, I just cannot seem to be able to print anything to the Output window of my Visual Studio 2012 (Ultimate). 出于某种原因,我似乎无法在Visual Studio 2012(Ultimate)的“输出”窗口中打印任何内容。 A quick run-down of what I tried: 我试过的快速破坏:

  • Put 'Solution Configurations' in debug mode 将“解决方案配置”置于调试模式
  • Put 'Show output from' in debug mode 在调试模式下放置'显示输出'
  • Right-click Output window to open a dialog and make sure 'Program Output' is checked. 右键单击“输出”窗口以打开对话框并确保选中“程序输出”。 In my case, I have everything checked 在我的情况下,我检查了一切
  • Tools | 工具| Options | 选项| Debugging -> 'Redirect all Output Window text to the Immediate Window' is UNchecked 调试 - >'将所有输出窗口文本重定向到立即窗口'是未选中的
  • Tools | 工具| Import and Export Settings -> Reset all settings (just in case I tweaked something unintentionally) 导入和导出设置 - >重置所有设置(以防我无意中调整了某些内容)

I've tried all of the above and some more to no avail. 我已经尝试了上述所有内容以及其他一些无效的内容。 I mean, I've spent a fair share of my time using a number of widely used IDEs but never had this much difficulty with simply trying to print something in the Output window. 我的意思是,我花了很多时间使用了许多广泛使用的IDE,但是在简单地尝试在“输出”窗口中打印某些内容时从未遇到过这么大的困难。

Lastly, it probably doesn't add any value to this post but here's my stupid-simple code: 最后,它可能不会给这篇文章增加任何价值,但这里是我的愚蠢的简单代码:

using System;
using System.Diagnostics;

namespace DataProc.classes
{
    class Program
    {
        static void Main(string[] args)
        {
            Debug.WriteLine("I hate you, silly VS!!!");
        }
    }
}

EDIT: (Adding web.config) 编辑:(添加web.config)

<configuration>
    <system.web>
        <compilation debug="true" targetFramework="4.5" />
        <httpRuntime targetFramework="4.5" />
    </system.web>
</configuration>

Try to reset VS2012 settings to default. 尝试将VS2012设置重置为默认值。 You can do it from command line as shown here: Reset VS2102 Settings 您可以从命令行执行此操作,如下所示: 重置VS2102设置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM