Autofac - Make sure that the controller has a parameterless public constructor

后端 未结 6 1225
情歌与酒
情歌与酒 2021-02-07 04:28

I know it\'s been asked and answered before - the reason I\'m asking is because (I think) I tried all suggested solutions to this problem but still can\'t resolve it.

I

6条回答
  •  旧巷少年郎
    2021-02-07 05:27

    I encountered this error as well and the root cause was that one of the Controller's dependencies wasn't registered correctly in Autofac.

    The InnerException has the detail (in my case it was an Autofac.Core.DependencyResolutionException) and the ExceptionMessage included the detail of this dependency. Along the lines of:

    "An error occurred during the activation of a particular registration... Cannot resolve parameter 'XXXX'

提交回复
热议问题