Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Application does not start in debugger

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

Here's what I do:

  • I rebuild the application and hit F5 to start it
  • The title of the VS2005-window says "projectname (Running) ..."
  • The debugger buttons appear but are greyed out
  • The application appears in the Windows task manager, but it has only 80k in memory usage
  • 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.
  • The application is still running, and still has only 80k in memory usage.
  • 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.

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.

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.

like image 501
Jonatan Avatar asked Jan 23 '10 12:01

Jonatan


People also ask

How do I start a program in debug mode?

Run the program in debug modeClick the Run icon in the gutter, then select Modify Run Configuration. Enter arguments in the Program arguments field. Click the Run button near the main method. From the menu, select Debug.

How do I run a .exe file in debugger?

Navigate to the .exe file, select it, and select Open. The file appears as a new project under the current solution. With the new file selected, start debugging the app by selecting an execution command, like Start Debugging, from the Debug menu.

Why is my Vscode debugger not working?

The most common problem is that you did not set up launch.json or there is a syntax error in that file. Alternatively, you might need to open a folder, since no-folder debugging does not support launch configurations.

How do I fix unable to start debugging on web server?

Restart your Application Pool. Check that your Web Application folder has the right permissions. Make sure that you give IIS_IUSRS, IUSR, or the specific user associated with the Application Pool read and execute rights for the Web Application folder. Fix the issue and restart your Application Pool.


2 Answers

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.

like image 67
Hans Passant Avatar answered Sep 22 '22 13:09

Hans Passant


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.

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 ... :)

like image 31
Jonatan Avatar answered Sep 25 '22 13:09

Jonatan