Why are try-catch in main() bad?
问题 Could someone explain to me why it is considered inapropriate to have a try-catch in the main() method to catch any unhandled exceptions? [STAThread] static void Main() { try { Application.Run(new Form1()); } catch (Exception e) { MessageBox.Show("General error: " + e.ToString()); } } I have the understanding that this is bad practice, but not sure why. 回答1: I don't think its necessarily bad practice. There are a few caveats however... I believe the point of whoever called this "bad practice"