Debugging errors in Raygun4Net

| 3 min. (624 words)

So you’ve integrated Raygun into your .Net project, followed the instructions to a T, and you’re still not seeing any errors on your dashboard. Or maybe your app used to report errors, but has stopped and you don’t know why. Don’t worry, I’m here to walk you through my debugging process so you can get back to zapping errors and cutting code like a pro. Lets start with the most common case:

You’ve added Raygun4Net and it’s not working.

The very first thing you should do is make sure you’ve got your API Key right. Copy-paste errors happen, it’s nothing to be ashamed about. Open your web.config or app.config (depending on whether you’re working on a website or app project, I’m just going to refer to it as your configuration file from now on), find your <RaygunSettings> element and check the apikey attribute and make sure it is set to the the right data (check your Application’s Settings for your API Key).

If this is set up correctly, you should be able to create a new Mindscape.Raygun4Net.RaygunClient, and it should have it’s API Key set automatically. You can test it with the following code:

new Mindscape.Raygun4Net.RaygunClient().Send(new Exception("Test message"));

This should create a new Error in your Raygun Application. If it doesn’t, we need to go deeper. In your configuration file, add the throwOnError="true" attribute to your <RaygunSettings> element. This will cause Raygun4Net to throw an Exception if it can’t report your Exceptions (how very meta). You then execute the Test code from above again with a debugger attached, and see if it throws an Exception while trying to send. This will let you know if there is some problem contacting Raygun, and give us something to work with if you contact support.

One error that I have come across a few times is incorrect <configSections> declarations in the configuration file. ConfigSections have a strict format – the `

Raygun used to work, but doesn’t any more

First things first – run through the diagnostic steps above, as if it never worked. Someone could have changed the code while you weren’t looking, or changed the firewall rules and blocked, or something else. At a minimum, run the test exception code to triple check that you can send test errors.

Another way things can go wrong is your trial account expiring. Once your trial has expired we stop processing errors – easy fix, sign up for one of our tasty plans. You can tell it’s in this state if you go to your Application Dashboard and it gives you “Your trial has expired” instead of your errors.

Another thing that can happen if you account is left expired for too long is your API Keys are rotated – it’s worth checking them if you’ve re-activated your account.

Finally, if you’ve picked “Reject all new errors until the start of my next billing cycle” on your plan or are an Azure or Heroku customer you might have exhausted your allocation of errors for the month. Check your Plan settings page, there’s a panel on the right that shows you how far through your Storage Limit you are this month. If it’s at 100% and we aren’t able to auto-upgrade you to the next plan (if you’ve chosen to disallow that, or are billed through Azure or Heroku) then we’ll stop accepting new errors for your account.

If none of this helps, then you need to talk to a human. Either email us at or click the Feedback link inside Raygun. The Feedback link is probably better as we can see your account details quicker that way, but either is fine. One of our lovely support people will be in touch as soon as they can.