I have this code:
private void btnNext_Click(object sender, RoutedEventArgs e){
try
{
// Lots of codes in here
}
catch (Exception ex)
{
System.Windows.MessageBox.Show(ex.Message + Environment.NewLine + ex.StackTrace.ToString())
}
finally
{}
}
It is catching an exception but not telling me where the exception is occurring inside the code. The only thing I'm getting is this.
Object reference not set to an instance of an object
at ProjectPath.btnNext_Click(Object sender, RoutedEventArgs e)
The release code works fine on a lot a machines, but on few machines, it throws this exception. I just can't figure out where on the code the exception is occurring while running on those machines. Is there a way to find the exact line where the exception is occurring? ex.StackTrace
didn't get the job done.
Any help will be appreciated.