No parameterless constructor defined for this object. in ASP.NET MVC Controller

后端 未结 6 1897
情话喂你
情话喂你 2021-01-11 19:19

I am sure this is quite straightforward but I am a bit stuck here. The routing defined for my app is just the default. I have the following controller defined.



        
6条回答
  •  孤独总比滥情好
    2021-01-11 20:04

    Most likely you have dependency injections mechanism. But MVC requires "special" way to register container. Look at this link Adding Unity to Your Web Applications, patterns and practices

提交回复
热议问题