There are two DLLs, A and B, in A.DLL there is a form class like this:
namespace AAA
public class AForm: Form
{
...
private void btnOK_Click(object sender, EventArgs e)
{
DoSomeSth();
}
}
In B.DLL, there is some code like this
try
{
AForm dlg = new AAA.AForm();
dlg.ShowDialog();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
There will be exception in the function DoSomeSth after OK button is clicked
When I debug the code using vs2005, the exception could be caught in B.DLL, but if I ran the application directly without debug, the exception won’t be caught in B.DLL, what is the reason?
This is a known issue. According to the KB article: