You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.
I've just spent a decent amount of time trying to debug the following exception:
System.ArgumentNullException
Object cannot be null.
Parameter name: source
at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Capture(Exception
source) at
Microsoft.Framework.DependencyInjection.ServiceLookup.Service.CreateInstanceCallSite.Invoke(ServiceProvider
provider) at
Microsoft.Framework.DependencyInjection.ServiceProvider.TransientCallSite.Invoke(ServiceProvider
provider) at
Microsoft.Framework.DependencyInjection.ServiceLookup.Service.ConstructorCallSite.Invoke(ServiceProvider
provider) at
Microsoft.Framework.DependencyInjection.ServiceProvider.TransientCallSite.Invoke(ServiceProvider
provider) at
Microsoft.Framework.DependencyInjection.ServiceProvider.<>c__DisplayClass8_0.b__0(ServiceProvider
provider) at
Microsoft.Framework.DependencyInjection.ServiceProvider.GetService(Type
serviceType) at
Microsoft.Framework.DependencyInjection.TypeActivator.ConstructorMatcher.CreateInstance(IServiceProvider
_services) at Microsoft.Framework.DependencyInjection.TypeActivator.CreateInstance(IServiceProvider
services, Type instanceType, Object[] parameters) at
Microsoft.AspNet.Mvc.DefaultControllerFactory.CreateController(ActionContext
actionContext)
Turns out all that was wrong was the constructor for my concrete implementation was marked as internal. Changing it to public works fine. I understand why, but the exception message was not helpful in trying to diagnose the issue.
The text was updated successfully, but these errors were encountered:
This exception also crops up when there's multiple public constructors on the class being instantiated.
I believe this gives a better error message with this commit by @davidfowl - adding the conditional when (ex.InnerException != null) should do it. Unfortunately, I'm not running against the daily builds so I can't confirm.
I've just spent a decent amount of time trying to debug the following exception:
Turns out all that was wrong was the constructor for my concrete implementation was marked as
internal
. Changing it topublic
works fine. I understand why, but the exception message was not helpful in trying to diagnose the issue.The text was updated successfully, but these errors were encountered: