当我的项目在本地机器上以调试模式运行时,我收到以下错误Value cannot be null.
Parameter name: key
。我试图调试它以查看导致问题的原因,但我运气不佳。当请求视图时,会抛出此错误但页面加载,我不知道是什么导致了这个问题。
我在下面包含了错误消息和堆栈跟踪:
System.ArgumentNullException was unhandled by user code
Message=Value cannot be null.
Parameter name: key
Source=mscorlib
ParamName=key
StackTrace:
at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
at System.Collections.Generic.Dictionary`2.ContainsKey(TKey key)
at StructureMap.Util.Cache`2.get_Item(KEY key)
at StructureMap.BuildSession.CreateInstance(Type pluginType)
at StructureMap.Container.GetInstance(Type pluginType)
at StructureMap.ObjectFactory.GetInstance(Type pluginType)
at MvcContrib.StructureMap.StructureMapControllerFactory.CreateController(RequestContext context, String controllerName) in c:\builds\mvccontrib\src\MvcContrib.StructureMap\StructureMapControllerFactory.cs:line 13
at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory)
at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state)
at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
InnerException: