G
Guest
Why is it so difficult to report bugs to Microsoft? I have a documented bug
and an small test example. I don't really see why I should have to pay to
tell them about it...
Anyway, the following code exhibits the bug. If it is built and run from
Visual Studio.NET 2003 in debug mode it works correctly as expected.
However, if built in Release mode it fails with an "uncaught exception"
error, although the exception does have a valid catch handler.
To repeat, create a new Windows Forms application and put the following code
into Form1.cs.
----
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
try
{
Application.Run(new Form1());
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Main: Caught exception: ");
}
}
private void button1_Click(object sender, System.EventArgs e)
{
try
{
Foo();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "button1_Click: Caught exception: ");
throw;
}
}
void Foo()
{
throw new Exception("Exception thrown from Foo()");
}
and an small test example. I don't really see why I should have to pay to
tell them about it...
Anyway, the following code exhibits the bug. If it is built and run from
Visual Studio.NET 2003 in debug mode it works correctly as expected.
However, if built in Release mode it fails with an "uncaught exception"
error, although the exception does have a valid catch handler.
To repeat, create a new Windows Forms application and put the following code
into Form1.cs.
----
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
try
{
Application.Run(new Form1());
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Main: Caught exception: ");
}
}
private void button1_Click(object sender, System.EventArgs e)
{
try
{
Foo();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "button1_Click: Caught exception: ");
throw;
}
}
void Foo()
{
throw new Exception("Exception thrown from Foo()");
}