public static void Main(string[] args) { ComponentInspectorApplication app = new ComponentInspectorApplication(); if (!app.ParseArguments(args)) { return; } try { app.Run(); app.Shutdown(); } catch (PolicyException pex) { ErrorDialog.Show(pex, "Security exception. You don't have sufficient permissions to run the Inspector.", "Insufficient Permissions", MessageBoxIcon.Error); return; } catch (SecurityException ex) { ErrorDialog.Show(ex, "Security exception. You don't have sufficient permissions to run the Inspector. Permission needed: " + ex.PermissionType + " state: " + ex.PermissionState, "Insufficient Permissions", MessageBoxIcon.Error); return; } catch (Exception ex) { ErrorDialog.Show(ex, "(bug, please report) Unhandled exception.", "Unhandled Exception", MessageBoxIcon.Error); return; } }