adiuva
adiuva

Reputation: 98

NBug configuration questions

Two questions regarding NBug:

  1. Can the NBug.config file be omitted if I'm having the configuration in the code like this:

    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;
          [...]
    }
    
  2. Why is this part of code never executed after a crash dump was created and the app restarted?

    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;
          }
          [...]
    }
    

Upvotes: 1

Views: 504

Answers (1)

Teoman Soygul
Teoman Soygul

Reputation: 25742

  1. Looks good, should work perfectly well.
  2. If you compile from the source code, put a break point here and see what happens: https://github.com/soygul/NBug/blob/d48942b844f3ea2a6e90b993f4c63565e0426944/NBug/Core/Submission/Custom/Custom.cs#L44

If you're using nuget package, it's outdated so might not work.

Upvotes: 1

Related Questions