473,396 Members | 2,121 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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

Hello,

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.

FB

//---------code-------------------
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()
{
InitializeComponent();
}
#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)
{
components.Dispose();
}
}
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();
this.SuspendLayout();
//
// 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,
117);
this.button1.Name = "button1";
this.button1.TabIndex = 1;
this.button1.Text = "button1";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5,
13);
this.ClientSize = new System.Drawing.Size(358, 254);
this.Controls.Add(this.button1);
this.Controls.Add(this.textBox1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);

}
#endregion

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

private void textBox1_Validating(object sender,
System.ComponentModel.CancelEventArgs e)
{
// place breakpoint on line below this one
if(textBox1.Text.Length<=0)
{
e.Cancel=true;
throw new Exception("Empty!");
}
else
{
e.Cancel=false;
}
}

private void textBox1_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
SendKeys.Send("{TAB}");
}
}
}
}
//-----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 2387

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

Similar topics

0
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...
5
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...
9
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...
0
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...
2
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...
2
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:...
0
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...
1
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...
18
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.