Can error reporting works on web applications?[solved]
xavier
Posts: 6
Hi,
Can somebody tell me if it's possible to use the error reporting feature with an ASP.Net MVC application?
Regards,
Xavier
Can somebody tell me if it's possible to use the error reporting feature with an ASP.Net MVC application?
Regards,
Xavier
Regards,
Xavier
Xavier
Comments
EXE that has been processed by SmartAssembly, or if you call ExceptionReporting.Report (Exception) manually.
Xavier
http://www.red-gate.com/supportcenter/C ... rtAssembly
Xavier
I'm trying to see if there is a better way of doing this where you can get the local variables as well as just the stack trace.
- Add a reference to c:\program files\red gate\smartassembly 6\SDK\bin\SmartAssembly.ReportException.dll in the web project
- Open the codebehind file for Global.asax in Notepad (or VS)
- If the method protected void Application_Error(Object sender, EventArgs e) does not exist, create it
- The method should contain these lines
- Save Global.asax.cs (or vb)
- Use Aspnet_Compiler to create pre-compiled code for the website
- Open the main DLL in a new SmartAssembly project (App_Web_xxx.dll)
- Make sure to use the options to merge the dependent DLLs (especially Global_asax.dll)
- Set up error reporting to report silently
- Build the DLL into a new folder in a "bin" subfolder (c:\mynewSAwebsite\bin)
- Copy all of the files that are not DLLs from the original compiled website to the one you just created
Using this method, you have created a global exception handler that will get the exception stack trace and local variables from the web application if it throws an unhandled exception.Exception exc = Server.GetLastError().GetBaseException();
SmartAssembly.ReportException.ExceptionReporting.Report(exc);
(aspnet_compiler -v "/" -p "c:\mywebsite" "c:\mynewwebsite")