FormDataCollectionExtensions (CreateActionContextForModelBinding) uses an incomplete HttpControllerContext, with only the configuration set (it calls the unit test-only constructor). Consumers normally expect (as an invariant) that request context, request, controller descriptor and controller are all set; attempts to access these properties during model binding in this case will return null unexpectedly.
Comments: It looks like this problem can't be fixed; there's public surface area to model bind this data without providing a request. For example: public static object ReadAs(this FormDataCollection formData, Type type) The best we could do is create an internal constructor and note that it's not just used for unit testing.
Comments: It looks like this problem can't be fixed; there's public surface area to model bind this data without providing a request. For example: public static object ReadAs(this FormDataCollection formData, Type type) The best we could do is create an internal constructor and note that it's not just used for unit testing.