【c#】InvalidOperationException: Unable to resolve service for type ‘WebAPI.Services.IPropertyCheckerS

报错信息:

InvalidOperationException: Unable to resolve service for type ‘WebAPI.Services.IPropertyCheckerService’ while attempting to activate ‘WebAPI.Controllers.CompaniesController’

结果图

【c#】InvalidOperationException: Unable to resolve service for type ‘WebAPI.Services.IPropertyCheckerS_第1张图片

原因

没有在Service里进行注册,在controller层就关联不到实际的service服务。

解决办法

【c#】InvalidOperationException: Unable to resolve service for type ‘WebAPI.Services.IPropertyCheckerS_第2张图片

你可能感兴趣的:(c#)