C#控制台应用程序-cmd.exe挂起 [英] C# Console Application - cmd.exe hangs

查看:56
本文介绍了C#控制台应用程序-cmd.exe挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio 2013中运行简单的C#控制台应用程序时遇到问题.

I am having issues with running a simple C# Console Application in Visual Studio 2013.

我的问题的详细信息:我已成功运行控制台应用程序,并在末尾清晰显示了默认的按任意键继续".突然,它开始表现出以下症状:

Details of my problem: I was running Console Applications successfully with the default "Press any key to continue" displaying cleanly at the end. Suddenly it started behaving differently with the following symptoms:

  • 在我的控制台应用程序旁边打开了一个新的命令窗口(cmd.exe)(过去从未发生过)

  • A new command window (cmd.exe) opening alongside my Console Application (this wasn't happening in the past)

我的控制台应用程序突然关闭,没有默认的按任意键"消息

My Console Application closing abruptly without the default clean "Press any key" message

cmd.exe挂起,即使通过任务管理器->结束进程,我也无法将其关闭

cmd.exe hangs and I am unable to close it, even through the Task Manager -> End Process

我的系统属性:

  • Visual Studio 2013 Ultimate
  • Windows 8,x64

这是我的控制台应用程序代码,只是为了证明这不是我的代码中的问题:

This is my Console Application code just to show that it isn't a problem in my code:

class Program
{
        static void Main(string[] args)
        {
            RegularTest();      
        }
        private static void RegularTest()
        {
            Console.WriteLine("This is the Regular Test. It works!");
        }
}

推荐答案

在几周内,我们在这里遇到了完全相同的问题!我们终于找到了解决方案!

We had the exact same problem here during several weeks ! And we finally found a solution !

在我们的例子中,是防病毒Avast 破坏了生成的 .exe

In our case, it was the anti-virus Avast which was corrupting the generated .exe !

解决方案是在生成发行版时简单地禁用所有代理!

The solution was to simply disable all agents while generating the release !

如果您使用其他防病毒软件,请尝试将其禁用.

If you use another anti-virus, try to disable it.

这篇关于C#控制台应用程序-cmd.exe挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆