'Step into' bug?

S

Ste

Hi all,
I usually use VB.Net, but I tryed to write a WindowsCE application with c#
and I've found a strange bug...I'd like to know if it is a Visual Studio
2003 bug or I write something wrong (or is a problem of my VS
installation...unfortunately I haven't another pc to test it!).

The problem is this: in the form created by VS I put a TextBox and a Button;
on Button Click routine, I write this code:

private void button1_Click(object sender, System.EventArgs e)
{
this.Test (this.textBox1.Width);
}

public void Test(int Value)
{
System.Windows.Forms.MessageBox.Show(Value.ToString());
}


If I put a breakpoint on Button1_Click routine, I can step into Test
routine normally pressing F11 key.
But if I create a new class (Class1) and move the Test routine into it, and
change button1_click routine in this way:

private void button1_Click(object sender, System.EventArgs e)
{
Class1 myClass;

myClass = new Class1();

myClass.Test(this.textBox1.Width);
}

when I try to step into Test routine of myClass, it doesn't work (obviously
I still have the breakpoint in button1_Click routine)!!

The only way to step into Test routine from button1_Click is to put a
breakpoint also into Test routine!!
In this sample I used Width property of TextBox, but I get the same
behaviour with other properties: for example, with Text property 'step into'
doesn't work, but if I write Text.ToString(), I can step into again!!!

Sorry for the length of the post and bad english....but anybody else has the
same problem???
 
G

Guest

Hi,

I'm not so sure why you have this behavior but you can try a few of things.
1. Delete all the \bin and \obj directories you have in your application's
directory
Rebuilt and try again

2. Put a breakpoint there instead and "F11 it"
myClass.Test(this.textBox1.Width);

3. Maybe check if you are still in Debug mode and did not switch to Release
somehow.

HTH,
Sitar.
___
 
S

Ste

Thank you for the response, Sitar, but it doesn't solved:
I'm not so sure why you have this behavior but you can try a few of
things.
1. Delete all the \bin and \obj directories you have in your application's
directory
Rebuilt and try again

Just tested, but doesn't work!
2. Put a breakpoint there instead and "F11 it"

I've put the breakpoint in several places of button1_Click routine, but no
one worked!

3. Maybe check if you are still in Debug mode and did not switch to
Release
somehow.

Unfortunately I'm in debug mode...the breakboint in button1_Click works, but
step-into doesn't!
 
G

Guest

You may need to close every instance of Visual Studio you have, delete the
bin\* obj\* and restart Visual Studio.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top