FIX: The Visual Studio .NET Debugger may stop responding if a method that is invoked through the immediate window quits the program (320349)



The information in this article applies to:

  • The Integrated Debugger, when used with:
    • Microsoft Visual Studio .NET (2002), Professional Edition

This article was previously published under Q320349

SYMPTOMS

Visual Studio .Net Debugger may stop responding (hang) if a method that is invoked through the immediate window quits the program. This only occurs if a breakpoint is set when the program quits.

RESOLUTION

To work around this problem, either avoid invoking methods from the immediate window that quits the program, or make sure to remove all of the breakpoints in the debugger.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in Microsoft Visual Studio .NET (2003), Professional Edition.

MORE INFORMATION

Steps to Reproduce the Problem

  1. Create a new Visual C# Console application.
  2. Replace Class1.cs with the following code:
    
    using System;
    namespace ConsoleApplication1
    {
    
    	class Class1
    	{
    
    		public static void Main(string[] args)
    		{
    		 	CheckVal(1);
    
    		}
    		public static void CheckVal(int i)
    		{
    			if (i<0) Environment.Exit(-1);
    			else return;
    		}
    	}
    }
    
    					
  3. Put a break-point at the CheckVal(1)line in Main function and run(F5).
  4. When the break-point is hit, type CheckValue(-1) in the immediate window, and then press ENTER.
  5. The program and the debugger stop responding.

Modification Type:MinorLast Reviewed:8/25/2005
Keywords:kbvs2002sp1sweep kbfix kbbug kbenv kbpending KB320349