When you set a break point on the close brace of a code block, the Visual Studio .NET debugger breaks at a different point (833901)
The information in this article applies to:
- Microsoft Visual Studio 2005 Standard Edition
- Microsoft Visual Studio 2005 Professional Edition
- Microsoft Visual Studio .NET (2003), Professional Edition
- Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2002), Professional Edition
- Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
- Microsoft Visual C# .NET (2002)
- Microsoft Visual C# .NET (2003)
SYMPTOMSWhen a break point is set on the close brace of a block of
code, at run time, the debugger in Microsoft Visual Studio .NET or in Microsoft Visual Studio 2005 breaks at the line that is next to the close brace when the code is executed.WORKAROUNDAdd a new statement before the close brace, and then add the
break point on the new statement instead of on the closing brace. For example, replace the code
in the Main function with following code: int b = 9;
if (b == 9 )
{
int a = new System.Random().Next();
Console.WriteLine("Debugger breaks here when the break point is set."); // Add a break point on this line.
}
Console.WriteLine("b = "+b);
STATUS This
behavior is by design.REFERENCESFor more information, visit the following Microsoft
Developer Network (MSDN) Web site:
Modification Type: | Major | Last Reviewed: | 2/28/2006 |
---|
Keywords: | kbvs2005swept kbvs2005applies kbIDEProject kbDebug kbVisIDDebugger kbprb KB833901 kbAudDeveloper |
---|
|