V
Vijayakrishna Pondala
Hi,
I am not able to catch exception that has been thrown from a static
constructor. I am using .NET v1.0. I am getting 'Unhandled Exception....'
Help!!
Here is my code snippet:
public class StaticTest
{
public StaticTest()
{
}
static StaticTest()
{
int i = 0;
try {
int j = 12/i;
} catch (Exception e) {
throw e;
}
}
static bool IsTrue()
{
return true;
}
}
I am calling this method from another class like this:
class A
{
//
public bool IsTrue()
{
try {
return StaticTest.IsTrue();
} catch (Exception ex) {
MessageBox.Show(ex.ToString());
}
}
I am not able to catch exception that has been thrown from a static
constructor. I am using .NET v1.0. I am getting 'Unhandled Exception....'
Help!!
Here is my code snippet:
public class StaticTest
{
public StaticTest()
{
}
static StaticTest()
{
int i = 0;
try {
int j = 12/i;
} catch (Exception e) {
throw e;
}
}
static bool IsTrue()
{
return true;
}
}
I am calling this method from another class like this:
class A
{
//
public bool IsTrue()
{
try {
return StaticTest.IsTrue();
} catch (Exception ex) {
MessageBox.Show(ex.ToString());
}
}