Categories
Programming

Some Handy NCrunch Tips

I have spent a little time today setting up NCrunch for Visual Studio. NCrunch is a handy extension that runs all your tests (unit and integration) in the background while you code and reports any failures to you as they happen. It also shows you code coverage in the margin of your actual code files. […]

Categories
Programming

The State Pattern

I have been looking at the State Pattern and I have noticed that the examples of the State Pattern online can be a bit confusing. This is largely due to the challenge of simplifying the code enough to make the example short. So this is my example of the State Pattern, a bit more complex […]

Categories
Programming

Using NCover Exclusions with MSBuild

I have previously discussed adding NCover to MSBuild and also how to get trend reporting as part of the NCover MSBuild target. Let’s add to all of that by filtering the NCover results to exclude stuff that you don’t want in your coverage reports. Remember, with great power comes great responsibility. Don’t exclude code unless […]

Categories
Programming

Using NCover with MSBuild to Get Reports and Trends

A while ago I wrote an article about how to get HTML Reports generated automatically by NCover as part of an MSBuild task. In this article, I extend the example in order to get trend reporting. In order to get trend reporting, you must specify a CoverageFile in your NCover task, and also an AppendTrendTo […]

Categories
Programming

ASP NET MVC Post/Redirect/Get Pattern

This is just a quick article to hopefully dispel some common misunderstandings of the ASP.NET MVC Post/Redirect/Get Pattern. First up, a quick explanation of what the Post/Redirect/Get (or PRG) Pattern is for those who don’t know. The Problem With A POST The common problem is that if you submit a form, you end up on […]

Categories
Programming

Adding an NCover Target to MSBuild to Get Code Coverage

This article describes how to add NCover code coverage to your MSBuild scripts in an extensible way. By using and adapting the example below, you should be able to get NCover results across your entire code base, all compiled into an excellent web-based summary. You might also be interested in generating Trend reports using MSBuild […]

Categories
Programming

Event Code 3005: An Unhandled Exception has Occurred

If you have come across this rather vague message (Event Code 3005: An Unhandled Exception has Occurred), you will have spotted that there are very few resources that give any reasonable answers on the root cause of the issue – that’s probably why you are here, so I will do my best to help. For […]

Categories
Programming

WPF BackgroundWorker and the Mysterious 0x80131623 Error

If you use Windows Presentation Foundation (WPF), you are very likely to come across the awesome BackgroundWorker and its best friend the Dispatcher. The BackgroundWorker lets you chuck a long-running process onto another thread, allowing the UI to remain responsive. When the BackgroundWorker needs to pop something on the UI, you ask the Dispatcher to […]

Categories
Programming

Improving Your Code with NDepend and CQL

I have been talking a fair bit recently about code quality tools such as Resharper and NDepend. In this article, I will explain how to use one of the features of NDepend to improve your code quality. On of my favourite features of NDepend is the suite of “code query language” tests, which run against […]

Categories
Programming

NDepend Contextual Help

I’ve talked a couple of times about NDepend recently, in the article NDepend For Beginners. NDpend is jammed full of code analysis tools, but sometimes you need a bit of a hint to tell you what is going on in the various matrix displays and graphs – well now NDepend is getting some improvements to […]