Dependency injection Sitecore XConnect:尝试创建类型为';的控制器时出错;接触器控制器';

Dependency injection Sitecore XConnect:尝试创建类型为';的控制器时出错;接触器控制器';,dependency-injection,sitecore,Dependency Injection,Sitecore,在Sitecore 9更新1中调用我的xConnect客户端时遇到问题。 客户端对象的初始化运行良好。 但当我在客户机上调用方法时,会出现以下异常: { "Message":"An error has occurred.", "ExceptionMessage":"An error occurred when trying to create a controller of type 'ContactsController'. Make sure that the contro

在Sitecore 9更新1中调用我的xConnect客户端时遇到问题。 客户端对象的初始化运行良好。 但当我在客户机上调用方法时,会出现以下异常:


{
    "Message":"An error has occurred.",
    "ExceptionMessage":"An error occurred when trying to create a controller of type 'ContactsController'. Make sure that the controller has a parameterless public constructor.",
    "ExceptionType":"System.InvalidOperationException",
    "StackTrace":"   at System.Web.Http.Dispatcher.DefaultHttpControllerActivator.Create(HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType)
   at Sitecore.XConnect.Web.DependencyInjection.WebApiServiceControllerActivator.Create(HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType)
   at System.Web.Http.Controllers.HttpControllerDescriptor.CreateController(HttpRequestMessage request)
   at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()",
    "InnerException":{
        "Message":"An error has occurred.",
        "ExceptionMessage":"Type 'Sitecore.XConnect.Web.Controllers.ContactsController' does not have a default constructor",
        "ExceptionType":"System.ArgumentException",
        "StackTrace":"   at System.Linq.Expressions.Expression.New(Type type)
       at System.Web.Http.Internal.TypeActivator.Create[TBase](Type instanceType)
       at System.Web.Http.Dispatcher.DefaultHttpControllerActivator.GetInstanceOrActivator(HttpRequestMessage request, Type controllerType, Func`1& activator)
       at System.Web.Http.Dispatcher.DefaultHttpControllerActivator.Create(HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType)"}}
  • 检查证书是否已为MMC中的xconnect应用程序池管理私钥
  • 如果第一个点现在不起作用,请尝试执行powershell命令:
  • Get Childitem cert:\LocalMachine\root-Recurse | Where Object{$\ uu.Issuer-ne$\ uu.Subject}| Move Item-Destination cert:\LocalMachine\CA

  • 如果第二个点不起作用,则检查以下两个服务是否正在运行:

  • 有什么解决办法吗?