ELMAH Code Snippets for Visual Studio

Thomas Ardal, November 21, 2014

Ever used Code Snippets in Visual Studio? Code Snippets is a great way to reduce keyboard input and help you be more productive by automating typing common lines of code.

At elmah.io we love ELMAH (big surprise). That’s why we have decided to open source the code snippets that we use internally to automate writing code against the ELMAH libraries. The snippets can be found at our organization on GitHub:

https://github.com/elmahio/ELMAHCodeSnippets

Let’s look at an example to see what the possibilities are using these snippets. Ever been frustrated doing manual logging to your ELMAH log using the ErrorSignal type? Not anymore with the tryraise snippet:

tryraise

When hitting the Tab key, the following code is generated:

tryraise Result

Pretty sweet, right? tryraise is one of 6 snippets available, but more will come. We also accept pull requests, so please send us your favorite ELMAH snippets or improve the ones already there.

To install the snippets, simply clone (or download) the git repository and import the snippets in the Code Snippet Manager from within Visual Studio.

But wait there’s more! You don’t even have to install the snippets manually. Our elmah.io extension for Visual Studio already ships with all of the snippets, making it super easy to install them using the Extensions and Updates feature:

Install elmah.io VS extension


This post was brought to you by the elmah.io team. elmah.io is the best error management system for .NET web applications. We monitor your website, alert you when errors start happening and help you fix errors fast.

Monitor your website



Comments