“Abp.AbpException: Unknown filter name: MayHaveTenant. Be sure this filter is registered before.”的解决方案

“Abp.AbpException: Unknown filter name: MayHaveTenant. Be sure this filter is registered before.”的解决方案

文章目录

描述

在使用 ABP 框架过程中,遇到 “Abp.AbpException: Unknown filter name: MayHaveTenant. Be sure this filter is registered before.” 错误。

WARN 2020-06-01 19:22:10,200 [10 ] Abp.BackgroundJobs.BackgroundJobManager - 
Abp.AbpException: Unknown filter name: MayHaveTenant. Be sure this filter is registered before.
at Abp.Domain.Uow.UnitOfWorkBase.GetFilterIndex(String filterName)
at Abp.Domain.Uow.UnitOfWorkBase.SetFilterParameter(String filterName, String parameterName, Object value)
at Abp.Domain.Uow.UnitOfWorkBase.SetTenantId(Nullable1 tenantId, Boolean switchMustHaveTenantEnableDisable) 
at Abp.Domain.Uow.UnitOfWorkBase.Begin(UnitOfWorkOptions options) 
at Abp.Domain.Uow.UnitOfWorkManager.Begin(UnitOfWorkOptions options) 
at Abp.Domain.Uow.UnitOfWorkInterceptor.InterceptSynchronous(IInvocation invocation) 
at Castle.DynamicProxy.AbstractInvocation.Proceed() 
at Castle.Proxies.BackgroundJobStoreProxy.GetWaitingJobs(Int32 maxResultCount) 
at Abp.BackgroundJobs.BackgroundJobManager.DoWork() 
at Castle.Proxies.BackgroundJobManagerProxy.DoWork_callback() 
at Castle.Proxies.Invocations.BackgroundJobManager_DoWork.InvokeMethodOnTarget() 
at Castle.DynamicProxy.AbstractInvocation.Proceed() 
at Castle.DynamicProxy.AbstractInvocation.Proceed() 
at Castle.Proxies.BackgroundJobManagerProxy.DoWork() 
at Abp.Threading.BackgroundWorkers.PeriodicBackgroundWorkerBase.Timer_Elapsed(Object sender, EventArgs e) 
Abp.AbpException: Unknown filter name: MayHaveTenant. Be sure this filter is registered before. 
at Abp.Domain.Uow.UnitOfWorkBase.GetFilterIndex(String filterName) 
at Abp.Domain.Uow.UnitOfWorkBase.SetFilterParameter(String filterName, String parameterName, Object value) 
at Abp.Domain.Uow.UnitOfWorkBase.SetTenantId(Nullable1 tenantId, Boolean switchMustHaveTenantEnableDisable)
at Abp.Domain.Uow.UnitOfWorkBase.Begin(UnitOfWorkOptions options)
at Abp.Domain.Uow.UnitOfWorkManager.Begin(UnitOfWorkOptions options)
at Abp.Domain.Uow.UnitOfWorkInterceptor.InterceptSynchronous(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.Proxies.BackgroundJobStoreProxy.GetWaitingJobs(Int32 maxResultCount)
at Abp.BackgroundJobs.BackgroundJobManager.DoWork()
at Castle.Proxies.BackgroundJobManagerProxy.DoWork_callback()
at Castle.Proxies.Invocations.BackgroundJobManager_DoWork.InvokeMethodOnTarget()
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.Proxies.BackgroundJobManagerProxy.DoWork()
at Abp.Threading.BackgroundWorkers.PeriodicBackgroundWorkerBase.Timer_Elapsed(Object sender, EventArgs e)

解决

搜索半天无果后,查 Git 找最近的更改,最终发现使用 InverseProperty 特性时,property 参数的值给错了,少了一个 s (需与反转对应的类中定义的名称完全一致)。记下来,以帮助遇到同样问题的同学。

“Abp.AbpException: Unknown filter name: MayHaveTenant. Be sure this filter is registered before.”的解决方案

本文由 .Net中文网 原创发布,欢迎大家踊跃转载。

转载请注明本文地址:https://www.byteflying.com/archives/3562

发表评论

登录后才能评论