Adding default Raygun logging for unhandled errors in ASP.Net MVC 5 VS2013
DC
Posted on
Oct 10 2013
I have just added Ray Gun to my new visual studio 2013 MVC 5 website. It's pretty much the bog standard template MVC site at the moment. I can't get the logging to fire on unhanded errors I tried adding the HttpModule and also modifying the Global.asax.cs Application_Error. In both cases nothing gets raised on error. I have turned on CustomErrors and the only way I can get RayGun to log unhanded errors is by putting the logging code into the Error.cshtml. I know this is a hack and want to fix it. Do I have to do anything differently with MVC 5?
When I compile I get the following information messages for web.config
Message 1 Could not find schema information for the element 'RaygunSettings' Message 2 Could not find schema information for the attribute 'mediumTrust' Message 3 Could not find schema information for the attribute 'apikey'
jeremy
Raygun
Posted on
Oct 15 2013
Do you still have the standard HandleError attribute defined in your FilterConfig? If so this will be suppressing the module from being called when CustomErrors are on (which is when it gets used). If you want to use this you will want to derive from the stock HandleErrorAttribute and add some logic to call RaygunClient.Send.
In terms of the information messages, that is normal. Its just Visual Studio mentioning that those schema elements in the config file are not known.
Jeremy