关于N Bug的两个问题:
如果我在代码中有这样的配置,是否可以省略 NBug.config 文件:
static void Main() { //NBug Crash Handling NBug.Settings.ReleaseMode = true; NBug.Settings.MiniDumpType = NBug.Enums.MiniDumpType.Normal; NBug.Settings.StopReportingAfter = 365; NBug.Settings.WriteLogToDisk = true; NBug.Settings.ExitApplicationImmediately = true; NBug.Settings.StoragePath = "WindowsTemp"; AppDomain.CurrentDomain.UnhandledException += NBug.Handler.UnhandledException; Application.ThreadException += NBug.Handler.ThreadException; [...] }
为什么在创建崩溃转储并重新启动应用程序后,这部分代码从未执行?
public MainMenu() { InitializeComponent(); //add handler on application load NBug.Settings.CustomSubmissionEvent += Settings_CustomSubmissionEvent; // Custom Submission Event handler void Settings_CustomSubmissionEvent(object sender, CustomSubmissionEventArgs e) { //your sumbmission code here... MessageBox.Show(e.FileName.ToString()); //..... //tell NBug if submission was successfull or not e.Result = true; } [...] }