Unity.WebApi | Make sure that the controller has a parameterless public constructor

前端 未结 6 500
独厮守ぢ
独厮守ぢ 2020-12-19 10:48

I am using the Unity.WebApi NuGet package (Unity 4.0.1 and Unity.WebApi 5.2.3) in an ASP.NET WebApi solution. The issue I am facing is that when attempting to run the code,

6条回答
  •  天命终不由人
    2020-12-19 11:48

    One more possible investigation path and cause for this issue. I set breakpoints on my global exception handler and looked into the nested exception property on my exception instance. I got the error does not have an accessible constructor which was true because the type I wanted to inject did have a private constructor (I was refactoring a singleton).

提交回复
热议问题