Be sure to check out Part 1 as this post builds upon it and the two go hand in hand. Series Overview Part 1 – Setting up logging with ASP.NET MVC, NLog and SQL Server Part 2 – Unhandled exception processing, building an error report, emailing errors, and custom error pages. Custom Error Handling Attribute…
ASP.NET NLog Sql Server Logging and Error Handling Part 1
It was the eleventh hour before a web app was to go live and there was nothing in place for error handling or logging. You’re shocked I’m sure (that’s my sarcastic voice). Normally with web apps in the past I’ve used ELMAH for unhandled error logging and NLog with text file targets for other logging.…
Scripting NuGet Package Updates (ASP.NET MVC 4)
After creating an ASP.NET MVC 4 web app I noticed in the Visual Studio Package Manager that there were several NuGet packages that had updates available. My first thought was just to update them from the dialog while I was there. That has a few problems though: You have to update packages one at a…
ASP.NET MVC 4 NUnit template
We are using ASP.NET MVC 4 beta on a new project as it should be out of beta before we go live. Even if not, they do have a Go Live license option. Each time I start using a new version of ASP.NET MVC and check the “Create a unit test project” checkbox, I always…
Ninject and NLog with Multiple Loggers
Today I wanted to add some simple file logging to my ASP.NET MVC application and I thought it would be a good time to try out NLog. I used log4net in the past but it has become stale and NLog appeared more modern and capable. I liked what I saw with NLog but I wanted…
T4MVC with separate view and controller projects
T4MVC A friend of mine recently informed me of T4MVC, a great little T4 template that generates some helper classes that allow for strongly referencing ASP.NET MVC controllers, actions, and views without those nasty hard-coded magic strings I detest. ReSharper helps validate those magic strings but I prefer to eliminate them entirely wherever possible. The…