A day with .Net

My day to day experince in .net

Value cannot be null.Parameter name: key Exception in StructureMap/Castle Windsor.

Posted by vivekcek on June 11, 2013

If you came across such an error from the below code base, when using structureMap.

 protected override IController GetControllerInstance(System.Web.Routing.RequestContext 

requestContext, Type controllerType)
        {
            return ObjectFactory.GetInstance(controllerType) as IController;
        }

add the following code in your Global.asax

routes.IgnoreRoute("favicon.ico");

You can analyse the error using ELMAH and see that, the request for favicon.ico cause the

exception.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s