<p>I am using Structure map like the MVC storefront by Rob Conery does and I have an AdminController and so to get to it I just type:</p>

<pre><code>website/Admin/action
</code></pre>

<p>however if I miss spell the controller name I get the error below:</p>

<p>Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: key</p>

<p>There error occurs on this line:</p>

<pre><code>Controller controller = ObjectFactory.GetInstance(controllerType) as Controller;
</code></pre>

<p>Does anyone have any ideas on how I can handle this error or not allow it to happen at all and maybe just goto a 404 page??</p>

<p>Cheers in advance</p>

You have a couple different options (or if you want, two things you can combine for a solution).  To remove some of the potential problems between the chair and address bar you can
implement a SoundEx solution
in C#
using the new routing framework to potentially capture some misspellings and re-route them to the expected URL (and/or add routes for what you believe common misspellings or requests will be).  This, however, isn't a solution that will fully solve the problem so you'll need to
look in to implementing custom error pages
for your application.