Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Project will not start in debug mode

I'm using VS2008, and I have a project that will not start when I press F5 or when I click the little green triangle in the toolbar. The screen flickers once, like the project is going to run, and then it doesn't. The build message claims the build was successful, but the project won't start.

In the Configuration Manager, my 'Active solution configuration:' is set to Debug, and in the 'Project contexts' list, the 'Configuration' column for my Project is set to Debug. I've even switched them back and forth between Debug and Release and then back to Debug, all with no effect. The project that I'm trying to run is set as the 'Startup Project' in my solution.

If I go to my \bin\Debug folder and double-click the .exe, (which shows the proper time-stamp on the file) my app runs just fine.

Any ideas why I can't get the silly thing to run in debug mode?

EDIT:
It's a winforms application.

My version of Visual Studio is 9.0.30729.1 SP

.NET Framework: Version 3.5 SP1

EDIT:

This may be related to TortoiseSVN. I keep my source code for this project in SVN. When I do a different/new checkout in TortoiseSVN, sometimes the new checkout will then allow the project to run. I don't understand the seemingly intermittent nature of this problem.

EDIT:

Not sure if this information is relevant to the problem, but when I do a new checkout and have a folder structure that is less deep (not as many nested folders) than the original checkout, I seem to have a better chance of the project running without problems.

EDIT: The problem had nothing to do with TortoiseSVN, see my answer below.

like image 513
Stewbob Avatar asked Feb 04 '10 21:02

Stewbob


People also ask

How do I run a project 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 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.

How do you fix Visual Studio Cannot start debugging because the debug target is missing?

Go to Build > Configuration Manager, and make sure the project has selected the Build. Then rebuild the project and see. If the answer is the right solution, please click "Accept Answer" and kindly upvote it.

How do I get out of debug mode?

To exit debug mode, press Alt+B followed by D. at the Command Prompt to exit debug mode.


3 Answers

IT ran some type of Windows update on my machine and that has apparently fixed the issue. It had something to do with a System.Runtime.InteropServices.COMException and an error in a 'Hosting' .dll. I'm not sure why a corrupt Hosting dll had an impact on a winforms application, but it has fixed the issue.

like image 101
Stewbob Avatar answered Oct 12 '22 19:10

Stewbob


I had a similar issue in the past. The project would not run in debug mode.

It was also caused by a corrupted dll, but not the 'Hosting' one. It's been a long time, so I don't recall the exact dll, but it had something to do with Messaging.

like image 20
GSTD Avatar answered Oct 12 '22 17:10

GSTD


There are actually some questions that are similar to yours. The most common workaround is to uncheck the "Enable the Visual Studio hosting process" in project properties.

I sometime has to switch between debugging under x64 bit to Any CPU; re-loading the project, and delete any *.suo files in the project folder.

like image 35
Tylor Avatar answered Oct 12 '22 17:10

Tylor