C# 无法使用ServiceLocator找到IValidator
使用sharparchitecture并尝试在域对象上调用IValidatable.IsValid时,出现以下错误 如何根据公共服务定位器注册NHibernate验证器的实例 我已经看到了以下单元测试: 如果您能帮上忙,我们将不胜感激C# 无法使用ServiceLocator找到IValidator,c#,nhibernate,s#arp-architecture,C#,Nhibernate,S#arp Architecture,使用sharparchitecture并尝试在域对象上调用IValidatable.IsValid时,出现以下错误 如何根据公共服务定位器注册NHibernate验证器的实例 我已经看到了以下单元测试: 如果您能帮上忙,我们将不胜感激 The needed dependency of type IValidator could not be located with the ServiceLocator. You'll need to register it with the Comm
The needed dependency of type IValidator could not be located with the ServiceLocator. You'll need to register it with the Common Service Locator (CSL) via your IoC's CSL adapter.
at SharpArch.Core.SafeServiceLocator`1.GetService() in C:\MyStuff\Projects\SharpArchGitHub\src\SharpArch\SharpArch.Core\SafeServiceLocator.cs:line 29
at SharpArch.Core.DomainModel.ValidatableObject.IsValid() in C:\MyStuff\Projects\SharpArchGitHub\src\SharpArch\SharpArch.Core\DomainModel\ValidatableObject .cs:line 11
at Tuhdoo.Common.Validation.ValidatableExtensions.Validate(IValidatable entity) in D:\Repository\Tuhdoo\src\Tuhdoo.Common\Validation\ValidatableExtensions.cs:line 26
很明显,当我意识到我没有在我的客户那里注册IValidator时,我有一瞬间大吃一惊。你使用的是什么IoC容器?