try-catch-FAIL

Failure is inevitable

NAVIGATION - SEARCH

SpecsFor V1.0 Released!

The first full, non-beta release of SpecsFor is finally out the door.  This release enables BDD style testing using NUnit, Moq, and StructureMap’s auto-mocking container.  You can grab the binary release from the CodePlex site, or you may use NuGet instead. The current version of SpecsFor depends on a few strongly-named packages.  These dependencies will be softened in the next release (more on that below), but you might run into versioning issues when using NuGet as David Ebbo described very well.  Fortunately NuGet’s ‘Add-BindingRedirect’ cmdlet works very well and w... [More]

Vote For Me At CodeStock 2011!

CodeStock is a great developer-driven event that’s hosted in Knoxville, TN.  It’s a terrific bargain: two days of learning and hanging out with other great devs, plus food and drinks, all for a price that’s significantly less than other similar events.  As is the case every year, attendees decide which sessions will be part of CodeStock.  I’ve submitted three sessions this year, and I want your votes! SOLID – What Is It Good For? Absolutely… Nothing!?!?! “Blasphemy! How dare you disparage the sacred acronym of SOLID?!?!!” Relax, I agree! SOLID is great. Paying attention ... [More]

Friday Programming Challenge–The Answer

Yesterday I presented a problem that I struggle with for several hours: given a generic Func<T,object> created by a fluent DSL, how can I call a method that only accepts a non-generic Func<object,object>?  The answer is actually quite simple. Here’s the relevant non-compiling code from yesterday: internal interface ISerializationConfig { ... void SerializePropertyAsElementUsing(Type target, PropertyInfo property, string elementName, Func<object, object> converter); } ... ITypeSerializationSpec<T> I... [More]

Friday Programming Challenge

It’s the first (and probably only) Friday Programming Challenge!  Today’s task is simple.  How can we pass a generic Func<T,object> to a method that only accepts a Func<object,object>?  Specifically, how can we make this code compile? internal interface ISerializationConfig { ... void SerializePropertyAsElementUsing(Type target, PropertyInfo property, string elementName, Func<object, object> converter); } ... ITypeSerializationSpec<T> IInitialPropertySerializationSpec<T>.Using(Func... [More]

Setting Certificate Permissions With Powershell

This post is more a reminder for me than anything else, but you may find it useful if you are scripting certificate-management tasks on Windows. The Certificate Manager snap-in for Windows allows you to manage permissions for certificates.  This is important if you want to, for example, grant your ASP.NET application the ability to use a private key from the certificate store in order to perform encryption/decryption operations.  While it is easy to script out many certificate-related operations with the makecert and other command-line tools from Microsoft, I failed to find anythin... [More]

A Cross-Version PowerShell Function To Restart IIS App Pools

The web is littered with different ways to restart IIS application pools.  Unfortunately, no one method that I’ve found works consistently across both IIS 6 and II7.  In this simple snippet, you can see the simple function I crafted that works across both current versions of IIS. function Restart-IISAppPool { param( $PoolName ) if (Test-Path c:\Windows\system32\inetsrv\appcmd.exe) { Write-Host "Restarting AppPool on IIS7..." c:\windows\system32\inetsrv\appcmd stop apppool /apppool.name:$PoolName c:\windows\system32\i... [More]

SpecsFor Released!

It’s not the official 1.0 release yet, but I have just published the first (and hopefully only) preview version of SpecsFor.   You can download it right now from the CodePlex site. This release meets most of the goals I laid out in my last post on SpecsFor, and if no bugs are found, SpecsFor Version 1.0 will follow shortly.  Read on to find out more! Main Features SpecsFor is a Behavior-Driven Development style framework that puts developer productivity ahead of all other goals.  The current release features: AutoMocking – Easily configure and verify behavior. ReS... [More]