472,985 Members | 2,894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,985 software developers and data experts.

[BUG]VS.NET 2003/C# locks up and locks up windows shell when entering breakpoint


It seems VS.NET 2003 locks up itself and the complete shell (mouse locks
also) when entering a breakpoint in a special situation.

Below is the code to reproduce this behavior. It contains a line where you
have to set a breakpoint (the first line in the validation event handler).
Compile and run in the debugger in vs.net using F5. When you hit 'enter'
in the textbox, the debugger should break in the validator routine where
you placed your breakpoint. However, it will lock up the shell: mouse will
not move, nothing will work. Your machine is not crashed, telnet to it and
kill the process started by the debugger or use another remote process
killer to kill the process.

This code is a proof of concept. In my actual code I use a similar
approach with the Enter key so a user can hit enter to move to the next
form field, which should then trigger the validation routine. This works
correctly, however in the debugger it locks up vs.net and the shell.

When you remove the code in the keydown routine, the debugger will break
in the validation routine. Also, when you run the code normally,
everything works fine, so it is not the code that is wrong, vs.net somehow
locks up (and the shell).

I use Windows XP pro sp1, VS.NET 2003 entr. arch.

Please fix.


using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace VSNetHang
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button1;
private System.ComponentModel.Container components = null;

public Form1()
#region Windows Form Designer generated code
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
if( disposing )
if (components != null)
base.Dispose( disposing );

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
this.textBox1 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
// textBox1
this.textBox1.Location = new System.Drawing.Point
(114, 36);
this.textBox1.Name = "textBox1";
this.textBox1.TabIndex = 0;
this.textBox1.Text = "";
this.textBox1.KeyDown += new
System.Windows.Forms.KeyEventHandler(this.textBox1 _KeyDown);
this.textBox1.Validating += new
System.ComponentModel.CancelEventHandler(this.text Box1_Validating);
// button1
this.button1.Location = new System.Drawing.Point(180,
this.button1.Name = "button1";
this.button1.TabIndex = 1;
this.button1.Text = "button1";
// Form1
this.AutoScaleBaseSize = new System.Drawing.Size(5,
this.ClientSize = new System.Drawing.Size(358, 254);
this.Name = "Form1";
this.Text = "Form1";


/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main()
Application.Run(new Form1());

private void textBox1_Validating(object sender,
System.ComponentModel.CancelEventArgs e)
// place breakpoint on line below this one
throw new Exception("Empty!");

private void textBox1_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e)
if (e.KeyCode == Keys.Enter)
//-----end of code--------

Solutions Design : http://www.sd.nl
My open source .NET Software : http://www.sd.nl/software
My .NET Blog : http://weblogs.asp.net/FBouma
Nov 13 '05 #1
0 2366

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Neil Moss | last post by:
Hi, I've got a repeatable nasty in my VS.NET 2003 IDE (running on WinXP Pro SP1). For an ASPX web form, in HTML mode, declare an element with a style attribute that includes an expression...
by: ajordan | last post by:
hello! i think i have a bug when i use parseFoat function: i have the following operation : parseFloat("10.664062") + parseFloat("10.664062") +parseFloat("10.664062"); the result of...
by: Raposa Velha | last post by:
Any of you ever catch this bug: I made a form and decided to copy it. Then I modified the cloned form. Then I run it and access start saying "Error accessing file. Network connection may have been...
by: Dextor | last post by:
I was hoping someone else could confirm this to be a bug in the new 1.1 framework when binding to a combo box. Here is the low down: When using the Oracle DataAdapter to return a query and fill a...
by: Martin | last post by:
I have encountered a bug in print preview: In my program, data for printing is taken from arrays. When print preview is invoked or page is printed directly, it is ok, but when user prints from...
by: bonk | last post by:
When I try to compile a MFC extension dll with /CLR in VS 2005 Beta 2. I get the following link errors: LNK2005: error _DLLMain@12 already defined in MyMFCDll.obj File: mfcs80ud.lib LNK2005:...
by: Shadow Lynx | last post by:
When using ASP.NET 2.0's built-in TreeView on a page with <BASE target = "AnythingBut_Self"></BASE> in the HEAD, the expand/collapse buttons fail to function. The reason for this is that the...
by: Cerebrus | last post by:
Hi all, Using : .NET 1.1, SQL Server 2000, Win 2K. Could anyone confirm if there is a bug in the SqlDataReader.GetChars() method when using CommandBehavior.SequentialAccess to get a BLOB...
by: ram | last post by:
Hi . . . I'm new to CSS, and have just started laying out my first table-free site; it's been both frustrating and rewarding. I've come across something that renders okay in Firefox/Opera, but...
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.