|
1 | 1 | Integration library for ASP.NET applications
|
2 |
| -========================== |
| 2 | +============================================ |
3 | 3 |
|
4 |
| -This library will detect all unhandled exceptions in ASP.NET-based applications and report them to your OneTrueError server (or your account at https://onetrueerror.com). |
| 4 | +[]() []() |
5 | 5 |
|
6 |
| -If you want to get automated handling for one of the ASP.NET derivatives, use the following libraries: |
| 6 | +This library will detect all unhandled exceptions in ASP.NET-based applications and report them to your codeRR server (or your account at https://coderrapp.com). |
7 | 7 |
|
8 |
| -* [ASP.NET MVC5](https://github.com/onetrueerror/onetrueerror.client.aspnet.mvc5) |
9 |
| -* [ASP.NET WebApi2](https://github.com/onetrueerror/onetrueerror.client.aspnet.webapi2) |
| 8 | +If you want to get automated exception handling for one of the ASP.NET-based libraries, use the following packages: |
10 | 9 |
|
| 10 | +* [ASP.NET MVC5](https://github.com/coderrapp/coderr.client.aspnet.mvc5) |
| 11 | +* [ASP.NET WebApi2](https://github.com/coderrapp/coderr.client.aspnet.webapi2) |
| 12 | +* [ASP.NET Core MVC](https://www.nuget.org/packages/codeRR.Client.AspNetCore.Mvc/) |
| 13 | + |
| 14 | +# Installation |
| 15 | + |
| 16 | +1. Download and install the [codeRR server](https://github.com/coderrapp/coderr.server) or create an account at [coderrapp.com](https://coderrapp.com) |
| 17 | +2. Install this client library (using nuget `coderr.client.aspnet`) |
| 18 | +3. Configure the credentials from your codeRR account in your `global.asax`. |
| 19 | + |
| 20 | +```csharp |
| 21 | +public class Global : System.Web.HttpApplication |
| 22 | +{ |
| 23 | + |
| 24 | + protected void Application_Start(object sender, EventArgs e) |
| 25 | + { |
| 26 | + //replace with your server URL and your appkey/SharedSecret. |
| 27 | + var uri = new Uri("https://report.coderrapp.com/"); |
| 28 | + Err.Configuration.Credentials(uri, |
| 29 | + "yourAppKey", |
| 30 | + "yourSharedSecret"); |
| 31 | + |
| 32 | + |
| 33 | + Err.Configuration.CatchAspNetExceptions(); |
| 34 | + } |
| 35 | +} |
| 36 | +``` |
| 37 | + |
| 38 | +# Manually reporting exceptions |
| 39 | + |
| 40 | +All unhandled exceptions are reported automatically by this library. |
| 41 | +But sometimes you need to deal with exceptions yourself. |
| 42 | + |
| 43 | +```csharp |
| 44 | +public void UpdatePost(int uid, ForumPost post) |
| 45 | +{ |
| 46 | + try |
| 47 | + { |
| 48 | + _service.Update(uid, post); |
| 49 | + } |
| 50 | + catch (Exception ex) |
| 51 | + { |
| 52 | + Err.Report(ex, new{ UserId = uid, ForumPost = post }); |
| 53 | + } |
| 54 | +} |
| 55 | +``` |
11 | 56 |
|
12 |
| -To report exceptions manually in your controller, use `OneTrue.Report(exception)`, OneTrueError will include information about the HttpRequest, QueryString, Form, Session etc when your exception is reported. |
13 | 57 |
|
14 | 58 | # Context collections
|
15 | 59 |
|
16 | 60 | This library includes the following context collections for every reported exceptions:
|
17 | 61 |
|
18 |
| -* All in the [core library](https://github.com/onetrueerror/onetrueerror.client) |
| 62 | +* All in the [core library](https://github.com/coderrapp/coderr.client) |
19 | 63 | * Application collection
|
20 | 64 | * Form data
|
21 | 65 | * Http headers
|
22 | 66 | * Query string parameters
|
23 | 67 | * Session data
|
24 | 68 | * Uploaded files
|
25 | 69 |
|
26 |
| -# Getting started |
| 70 | +# Requirements |
| 71 | + |
| 72 | +You need to either install [codeRR Community Server](https://github.com/coderrapp/coderr.server) or use [codeRR Live](https://coderrapp.com/live). |
27 | 73 |
|
28 |
| -1. Download and install the [OneTrueError server](https://github.com/onetrueerror/onetrueerror.server) or create an account at [OneTrueError.com](https://onetrueerror.com) |
29 |
| -2. Install this client library (using nuget `onetrueerror.client.aspnet`) |
30 |
| -3. Configure the credentials from your OneTrueError account in your `Global.asax` |
31 |
| -4. Add `OneTrue.Configuration.CatchAspNetExceptions()` in your `Global.asax` |
| 74 | +# More information |
32 | 75 |
|
33 |
| -Done. |
| 76 | +* [Questions/Help](http://discuss.coderrapp.com) |
| 77 | +* [Documentation](https://coderrapp.com/documentation/client/libraries/aspnet/) |
0 commit comments