Go Premium for a chance to win a PS4. Enter to Win


VS2010 Debug works for a while and then simply does nothing

Posted on 2011-02-11
Medium Priority
Last Modified: 2012-05-11
This is driving me bats.

I'll be coding, then debugging and doing the usual: edit, debug, test, edit, debug, test, etc.  Everything is fine for a while and then, out of the blue, I'll press F5 or the little green "play" button and it looks like it's going to do something (the play button dims) and then it just returns to the editor (the play button goes green again).

Nothing.  No error messages, nothing breaks, the code changes are not breaking anything.  Just doesn't want to debug anymore.  (That's two of us.)

1. 64bit Win 7 (all patched)
2. VS2010 (all patched)
3. Always goes back to working on reboot.
4. Sometimes goes back to working on restarting VS2010
5. Not project specific
6. No error messages of any kind
7. No known hardware issues (happens on my desktop, too)
8. Switching the config drop down in the tool bar from debug to release will make the problem stop - for a while.  Then it starts again in release mode.

The only other thing I've seen like it is the problem with Win 7 where if you have a folder sorted by Date modified, deleting the file doesn't refresh the display right away.  The file looks like it's still there, but it's not.  Change it to sort by name and the deletion takes place immediately.  Maybe this is related.

I can't get squat done like this.

Has anyone seen anything like this?  I've checked all over but even the research is taking forever and I'm not getting anywhere.

Thanks in advance.
Question by:nhwilly
  • 7
  • 6

Expert Comment

ID: 34878303
Have you tried just stopping Visual Studio and then starting again and loading up the project? Rather than rebooting the whole machine.

Author Comment

ID: 34879102
Yes. See #4 above. Exit out of VS, wait 20 minutes. Still does nothing.

Expert Comment

ID: 34880039
There seems to be a problem with the VS2010 debugger in that it randomly just ignores breakpoints, especially when related to unit tests.
Microsoft think they have a fix:
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.


Author Comment

ID: 34883827
I'm not sure I've experienced that exactly.  I have had conditions where a change in a dll that is referenced in a project is not updated, meaning that code in the dll that are set as break points don't get executed.  But they appear as a hollow dot and there's a tooltip that says as much.

That's not what's happening here.

My problem doesn't involve breakbpoints.  Just running the program.   Maybe they're related, I don't know.

Thanks, though.

Expert Comment

ID: 34885855
Let me understand you correctly.
You debug your program and edit changes continuously. Your wording implies you use F5 (run) rather than F10 (step into) when you do this, and you wait till the breakpoint over the code being examined is triggered for execution to stop.
Occasionally, you press F5 and the program "just returns to the editor", with no signs of problems or even of execution.

(1) Are you saying the program does not execute on these occasions, or that it executes but just doesn't stop at your breakpoints?

(2) If you had no breakpoints set, and pressed F5, would the behaviour of your program differ in any way from when you experience one of these Debug failures?


Author Comment

ID: 34887834
#1 - correct.Breakpoints set or not - still does nothing. Doesn't run at all.

#2. - that's right. No difference in behavior.

Odd isn't it?

Expert Comment

ID: 34891685
OK, If there is no difference in behaviour between running your code without breakpoints, and running your code when one of these debug failures occur, on what basis do you assert that the program does not run at all on these failure occassions?

Is there some action your program does that can be independently verified (like writing to a file)? So that you can say "my program did not run" if that action is not done?

If yes, then you response to my question #2 is incorrect. If no, then we can investigate further.

Author Comment

ID: 34891991
Well, this would be a form that should display, or a console window that should show some results or whatever.

I press F5 and it looks like it's going to start up, but then just returns to the editor.  Nothing happens at all.  Almost like my program started to run and then exited without doing any work or displaying any errors.

I guess I should not have classified this as solely a debug problem.  I just always run in debug mode during my development.

It also happens when I run the program in "release" mode and there are no breakpoints set, either.

Expert Comment

ID: 34892197
OK, the fact that this problem happens in release mode is an important bit of information that was ommitted in you original description.
Does this problem also happen outside of the IDE? Have you run and rerun this program stand-alone and seen this problem?
Is your program an exe or a dll?
If an exe, is it a Console app or a Windows form, or is it a service?
If a dll, how are you calling it?

Author Comment

ID: 34893294
Oh, I thought #8 in my first post was clear that it happens in release mode.

What might not have been clear, and for that I apologize, is that this never happens outside of the IDE.

I don't write services often and this has happened in WPF and console apps.  Been a long time since I've done any WinForms stuff.  All inside the IDE.

These are all exe's, but the solutions are often made up of multiple projects, which are referenced properly and then namespaces imported.

Happens in VB and in C#.

Expert Comment

ID: 34912481
OK, another point of clarification (PS. apologies about missing point 8)
You say that "these are all exes, but the solutions are made up of multiople objects..."
So, You have a project that copiles to an exe. This project contains multiple projects (all executables) that are referenced from your program... How are you calling them?
These programs are made up of multiple objects...I take this to mean that these objects are separately compiled objects (such as DLLs) and not ojects created within code within your program?

Author Comment

ID: 34913107
Right, I'll have a business DLL containing my basic entities in one project.  In another project, I'll have a console application that compiles to an EXE.

The console app EXE uses the DLL entities to do work.

Textbook organization.

Accepted Solution

Orcbighter earned 2000 total points
ID: 34913511
So now we have a clearer picture.
The problem where you press F5 and it goes returns to the IDE without any action, notably, showing the console screen, is indicative of a failure to call a DLL.
If the DLLs are preloaded then they are checked first before any other part of the execution, inclusing showing the console window. So, if the load fails, the app aborts.
One reason for the app failing to access the dll is that it may still be loaded and running from a previous run. This would explain why the problem does not occur outside the IDE. Even in Release mode, the IDE has its fingers in the pie, even if they are not readily apparent.
Maybe you should look at how your programs clean up after botrh successful execution and aborted execution. Is a handle to one of these DLLs being kept even when the program has stopped? Thus when you run the program again, it is locked outor fails to load for some reason.
This could be a place to investigate.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question