c# - Visual Studio 停止运行我的程序

标签 c# c++ visual-studio visual-studio-2012

场景:我有一段时间没有在家编写代码了,想使用 Visual Studio 2012 Express 启动我的第一个 C++ 服务器客户端应用程序。但是当我点击运行按钮时,VS 卡住了。代码没有任何问题,所以我认为问题出在我不知道的一些 VS 设置上,或者我不小心下载了一个更新,这让事情变得更糟。

问题:点击播放按钮(选择调试 Win32)会卡住 VS。 taskmanager 还获得了正在运行的程序的 3 个进程(我无法与之交互)。除非我重新启动计算机,否则无法终止这些进程。

规范:Visual Studio 2012 Express,Windows 7,64 位。 Avast Premier 2015。

#include <iostream>

int main() {
    printf("tilt");
    return 0;
}

自调试:我尝试在新项目中制作新的 Hello World 程序,但问题仍然存在。如果我打开一个我知道以前工作过的旧项目,它也会有同样的问题,而无需我修改任何东西。我改用 C# 但我仍然无法运行一个简单的程序。我修复了我的VS。我安装了 Visual Studio 2015 Community,但仍然无法运行任何程序。

错误信息:

the process cannot access the file because it is being used by another process

visual studio could not copy exceeded retry count of 10. failed

Microsoft.Common.targets(3390,5)

Linker Tools Error LNK4098

error LNK1168: cannot open tiltTest.exe for writing

error LNK1181: cannot open input file 'kernel32.lib' //after repairing VS

相关链接:

Visual Studio Hangs in debug?

Visual Studio 2015 freezes when debugging a cpp code

Windows Forms application remains alive in task manager after hitting "stop debugging" button

Visual Studio "Could not copy" .... during build

Resolving LNK4098: defaultlib 'MSVCRT' conflicts with

visual studio linker warning LNK4098

http://www.bytemedev.com/how-to-fix-visual-studio-error-the-process-cannot-access-the-file-because-it-is-being-used-by-another-process/

最后的话:我真的不擅长链接、设置、库和任何非代码的东西。所以如果你知道如何使用这些解决它,请期待我是一个真正的初学者,因为所有这些对我来说都是完全困惑和不合逻辑的。帮助将不胜感激!如果找到解决方案,我将修改这篇文章,以便其他人也能找到解决方案。

解决方案: 我重新安装了 Visual Studio 并关闭了 Avast,这解决了我的问题!感谢您的建议!

最佳答案

给出有关另一个进程使用该文件的错误消息,这可能是因为防病毒软件在 Visual Studio 尝试访问文件的同时尝试扫描文件。

我会先尝试关闭 Avast(或任何其他防病毒软件)。 (如果您对病毒有疑虑,请断开计算机与互联网的连接)。

如果现在一切正常,请在源文件夹的 AV 中添加一个排除项,这样它就不会扫描您的代码 - 毕竟您知道您创建的可执行文件中不会有任何病毒(对吗?)。这还将有一个额外的好处,可以加快您的编译/链接速度,因为 AV 不会检查您每次构建时可能要修改的(可能)100 个文件。

关于c# - Visual Studio 停止运行我的程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34432785/

相关文章:

c++ - 指针数组为什么会出现段错误?

c++ - 打印出错误的值

c# - 如果 itemsource 中不存在值,则 Combobox 分配 null

c++ - 项目错误 : Unknown module(s) in QT: quick

c++ - Qt Designer 代码生成问题

visual-studio - 无法在具有慢速(玻利维亚)互联网的 Visual Studio for Mac 和 dotnet 核心中恢复 nuget 包

visual-studio - 在 Visual C++ Express Edition 中使用 GLUT

c# - 如何从编码的 UI 测试创建可执行文件(最好是 .exe 而不是命令行)?

c# - 您创建实例以调用静态方法的模式的名称

c# - 我可以将 'using' 上下文传递给 c# 中的另一个方法吗?