应用程序在调试器中不启动

时间:2021-07-02 19:31:21

The application I'm working does not start in the debugger of Visual Studio 2005.

我正在使用的应用程序并不是在Visual Studio 2005的调试器中启动的。

Here's what I do:

这是我做的:

  • I rebuild the application and hit F5 to start it
  • 我重新构建应用程序并按F5启动它
  • The title of the VS2005-window says "projectname (Running) ..."
  • VS2005-window的标题是“projectname(正在运行)…”
  • The debugger buttons appear but are greyed out
  • 调试器按钮出现了,但显示为灰色
  • The application appears in the Windows task manager, but it has only 80k in memory usage
  • 该应用程序出现在Windows任务管理器中,但在内存使用中只有80k。
  • Nothing happens for a long while, and finally I get a windows with the following error message: "Debugging is being stopped but is not yet complete. You can force debugging to stop immediately, but any process being detached may be terminated instead. This window will automatically close when the debugging has completely stopped". The window does not disappear, so after a while I press the "Stop now" button.
  • 很长一段时间内没有发生任何事情,最后我得到了一个带有以下错误消息的窗口:“调试正在停止,但还没有完成。”您可以强制调试立即停止,但是任何被分离的进程都可能被终止。当调试完全停止时,此窗口将自动关闭。窗口不会消失,所以在一段时间之后,我按下“现在停止”按钮。
  • Nothing happens for a while (the debugger buttons still visible, but greyed)
  • 一段时间内没有发生任何事情(调试器按钮仍然可见,但是灰色)
  • Some time later a new window appears: "Unable to start program '(path to exe)'. OLE har skickat en begäran och väntar på svar". The last sentence is swedish for "OLE has sent a request and is waiting for response". I press OK and the debugger buttons are gone.
  • 过了一段时间,会出现一个新窗口:“无法启动程序”(到exe的路径)。奥莱·哈尔·斯凯克特·贝加兰·奥瓦塔尔·斯瓦尔”。最后一句是瑞典语,“OLE已经发出了请求,正在等待答复”。我按下OK,调试器按钮就消失了。
  • The application is still running, and still has only 80k in memory usage.
  • 应用程序仍在运行,内存使用仍然只有80k。
  • I try to end the process with the task manager, but it is not killed.
  • 我试图用任务管理器来结束这个过程,但它并没有被终止。
  • I quit Visual Studio and finally the process is gone.
  • 我退出了Visual Studio,最终这个过程结束了。

The application is an unmanaged C++ project, that use a lot of DLL-files as plugins. I'm using the "multi-threaded debug" runtime, and I've made sure all dependencies are compiled against the same runtime.

该应用程序是一个非托管的c++项目,它使用大量的dll文件作为插件。我正在使用“多线程调试”运行时,并确保所有依赖项都是针对相同的运行时编译的。

It was while doing that this problem appeared all of a sudden. I've tried to reverse my changes, but it doesn't help. Restarting the computer doesn't help either.

正是在这样做的时候,这个问题突然出现了。我已经尝试过改变,但无济于事。重启电脑也无济于事。

I've got the application running once or twice at random. If I then ended the application and started it again it wasn't started. So I don't think this is because of my configuration.

我让应用程序随机运行一两次。如果我结束应用程序并重新启动它,那么它就没有启动。我不认为这是因为我的构型。

Any ideas?

什么好主意吗?

One more note: the application starts and runs as it should if I start it from outside Visual Studio.

还有一点要注意的是:如果我从Visual Studio外部启动应用程序,那么应用程序将按照它应该的方式启动和运行。

2 个解决方案

#1


2  

Sounds like a misbehaving DllMain() in one of the implicitly linked DLLs used by your program. You might get a hint from the Output window, it lists the names of the DLLs as they get loaded. If it is wininet.dll then you've fallen into a deadlock trap with the symbol server.

听起来像是程序使用的隐式链接dll中的一个行为不端的DllMain()。您可能会从输出窗口得到一个提示,它会在dll被加载时列出它们的名称。如果它是经由wininet。然后您就陷入了与符号服务器的死锁陷阱。

#2


1  

Ok, I've solved my problem, but I have no idea how.

好吧,我已经解决了我的问题,但是我不知道怎么解决。

One thing i tried was deleting all build files and exe and dll files, and then recompile everything. But that didn't help.

我尝试的一件事是删除所有构建文件、exe和dll文件,然后重新编译所有文件。但这并没有帮助。

I then tried one thing at random: the plugins were in the same solution. So I removed them and tried to run again. And this time it worked! So I added all the plugin-projects back, and it still works!

然后我随机地尝试了一件事:插件在同一个解决方案中。所以我把它们拿掉,再试着跑。这次成功了!所以我把所有的插件项目都加回来了,它仍然可以工作!

So, I guess I will never know what happened. But removing and adding a project to a solution might solve someone elses problem too ... :)

所以,我想我永远也不会知道发生了什么。但是,将一个项目移除并添加到解决方案中可能也会解决一些人的问题……:)

#1


2  

Sounds like a misbehaving DllMain() in one of the implicitly linked DLLs used by your program. You might get a hint from the Output window, it lists the names of the DLLs as they get loaded. If it is wininet.dll then you've fallen into a deadlock trap with the symbol server.

听起来像是程序使用的隐式链接dll中的一个行为不端的DllMain()。您可能会从输出窗口得到一个提示,它会在dll被加载时列出它们的名称。如果它是经由wininet。然后您就陷入了与符号服务器的死锁陷阱。

#2


1  

Ok, I've solved my problem, but I have no idea how.

好吧,我已经解决了我的问题,但是我不知道怎么解决。

One thing i tried was deleting all build files and exe and dll files, and then recompile everything. But that didn't help.

我尝试的一件事是删除所有构建文件、exe和dll文件,然后重新编译所有文件。但这并没有帮助。

I then tried one thing at random: the plugins were in the same solution. So I removed them and tried to run again. And this time it worked! So I added all the plugin-projects back, and it still works!

然后我随机地尝试了一件事:插件在同一个解决方案中。所以我把它们拿掉,再试着跑。这次成功了!所以我把所有的插件项目都加回来了,它仍然可以工作!

So, I guess I will never know what happened. But removing and adding a project to a solution might solve someone elses problem too ... :)

所以,我想我永远也不会知道发生了什么。但是,将一个项目移除并添加到解决方案中可能也会解决一些人的问题……:)