try-catch-FAIL

Failure is inevitable

NAVIGATION - SEARCH

Announcing SpecsFor: Yet Another BDD Framework For .NET!

There is no shortage of Test/Behavior-Driven Development frameworks for .NET.  You have SpecFlow, Machine.Specifications (MSpec), and even Cucumber.  While these frameworks have been around for a while, I felt they weren’t right for me for various reasons, so I created SpecsFor.  SpecsFor is a TDD/BDD framework that has been naturally cultivated from use on two projects, including one commercial app.  The first release of SpecsFor is in the works, but first, I need feedback on some changes I’m considering to the core API. But why?? I have previously shown the SpecsFor te... [More]

Handling Authorization Failures for AJAX Requests in ASP.NET MVC Applications

Authorization failures in ASP.NET MVC applications are usually not something you worry about.  The ASP.NET pipeline has solid support for this scenario and will redirect the user to your application’s login page for you automagically.  Unfortunately, things become more complicated once you introduce AJAX requests into the mix.  Without doing some extra work, you can create a bad user experience and increase the burden of developing AJAX-enabled client script.  In this post, I’ll show you an elegant way to handle authorization failures that overcomes these problems. The Pr... [More]

Asynchronous Event Processing With The Application Bus

I’ve shown you how to use an Application Bus to dispatch events in your application, making it easier to craft code that is loosely coupled and more maintainable.  One of the enhancements I briefly mentioned was to make the event handlers execute asynchronously, thereby enabling your event handlers to run in parallel.  This is quite easy to implement, as I’ll show you in this post. Before we get started, note that the code I’m showing you here has not been used in anything resembling a production environment.  While the tests I’ve performed work, there may be issues with the co... [More]