Value cannot be null. Parameter name: serviceKey

Topics: Troubleshooting
Mar 25, 2011 at 8:16 PM

No customization, just downloaded the lastest from source, opened the solution in vs 2010, hit the little green arrow, was prompted to setup up the site, then goto edit the page content type:


And I get the error in HttpAsyncHandler.BeginProcessRequest. Very hard to trace down problems when the stack looks like this:


>Orchard.Framework.DLL!Orchard.Mvc.Routes.ShellRoute.HttpAsyncHandler.BeginProcessRequest(System.Web.HttpContext context, System.AsyncCallback cb, object extraData) Line 148 + 0x5 bytes
[External Code]


Mar 25, 2011 at 8:56 PM
Edited Mar 25, 2011 at 9:02 PM

Version: 1.0.20

I downloaded:

This doesn't 'break' the page, you can just skip over it.

Mar 25, 2011 at 11:38 PM

I can't reproduce this on the latest dev branch.

Mar 28, 2011 at 7:18 PM
Edited Mar 28, 2011 at 7:50 PM

Well that's helpful. I'll work through the problem myself and post my findings.

Mar 28, 2011 at 8:22 PM
Edited Mar 28, 2011 at 8:23 PM

ShellRoute.BeginProcessRequest invoked 3 times when handling request for "Admin/ContentTypes/Edit/Page"

1st go-thru:
OrchardControllerFactory.GetControllerType is invoked

  • areaName = Orchard.ContentTypes. 
  • serviceKey = orchard.contenttypes/admin
  • ... whatever things seem to go smoothly

2nd go-thru:
_httpAsyncHandler.BeginProcessRequest doesn't seem to do anything, but f11 on the last line of BeginProcessRequest and something to do with Filters happens

3rd go-thru:

  • OrchardControllerFactory.GetControllerType is invoked
    • areaName = Orchard.Modules
    • serviceKey = orchard.modules/orchard.contenttypes
    • Returns Null
  • OrchardControllerFactory.GetControllerInstance
    • since GetControllerType returned null, when this method calls TryResolve<T>, it errors out when trying to construct a new KeyedService


Mar 31, 2011 at 11:20 PM

I'd love to help but I'm not sure what the repro steps are.

Mar 31, 2011 at 11:22 PM

It happens to me randomly on my 1.0.20 instance. Haven't noticed it in 1.1 at all so hopefully it's fixed.