Solved

VS2010 Debug works for a while and then simply does nothing

Posted on 2011-02-11
13
1,300 Views
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.)

Clues:
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.
0
Comment
Question by:nhwilly
  • 7
  • 6
13 Comments
 
LVL 9

Expert Comment

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

Author Comment

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

Expert Comment

by:Orcbighter
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:
http://blogs.msdn.com/b/jasonz/archive/2010/12/07/announcing-visual-studio-2010-service-pack-1-beta.aspx
.
0
 

Author Comment

by:nhwilly
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.
0
 
LVL 9

Expert Comment

by:Orcbighter
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?

0
 

Author Comment

by:nhwilly
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?
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 9

Expert Comment

by:Orcbighter
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.
0
 

Author Comment

by:nhwilly
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.
0
 
LVL 9

Expert Comment

by:Orcbighter
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?
0
 

Author Comment

by:nhwilly
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#.
0
 
LVL 9

Expert Comment

by:Orcbighter
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?
0
 

Author Comment

by:nhwilly
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.
0
 
LVL 9

Accepted Solution

by:
Orcbighter earned 500 total points
ID: 34913511
OK,
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.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
Viewers will learn the different options available in the Backstage view in Excel 2013.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now