An exception was thrown while activating Castle.Proxies.ProcedureAppServiceProxy.
Autofac.Core.DependencyResolutionException: An exception was thrown while activating Castle.Proxies.ProcedureAppServiceProxy.
---> Autofac.Core.DependencyResolutionException: None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'Castle.Proxies.ProcedureAppServiceProxy' can be invoked with the available services and parameters:
Cannot resolve parameter 'Volo.Abp.Domain.Repositories.IRepository`2[SnAbp.ConstructionBase.Entities.ProcedureRltFile,System.Guid] procedureRltFileRepo' of constructor 'Void .ctor(Castle.DynamicProxy.IInterceptor[], Volo.Abp.Domain.Repositories.IRepository`2[SnAbp.ConstructionBase.Entities.Procedure,System.Guid], Volo.Abp.Domain.Repositories.IRepository`2[SnAbp.ConstructionBase.Entities.ProcedureMaterial,System.Guid], Volo.Abp.Domain.Repositories.IRepository`2[SnAbp.ConstructionBase.Entities.ProcedureWorker,System.Guid], Volo.Abp.Domain.Repositories.IRepository`2[SnAbp.ConstructionBase.Entities.ProcedureEquipmentTeam,System.Guid], Volo.Abp.Domain.Repositories.IRepository`2[SnAbp.ConstructionBase.Entities.ProcedureRltFile,System.Guid], Volo.Abp.Guids.IGuidGenerator, Volo.Abp.Domain.Repositories.IRepository`2[SnAbp.Identity.DataDictionary,System.Guid])'.
Autofac.Core.DependencyResolutionException:激活Castle.Proxies.ProcedureAppServiceProxy時引發了異常。
---> Autofac.Core.DependencyResolutionException:不能使用可用服務和參數調用類型為'Castle.Proxies.ProcedureAppServiceProxy'的'Autofac.Core.Activators.Reflection.DefaultConstructorFinder'發現的構造函數:
無法解析構造函數'Void .ctor(Castle.DynamicProxy.IInterceptor [],Volo.Abp.Domain的構造函
說某個倉儲 IRepository 沒有 構造函數 參數
這個時候 檢查下 IDbContext 和 DbContext ,把 對應 缺失 的 dbSet 補上就可以了
2021年6月17號更新 記住一定要把 dbset<T> 寫在構造函數 上 面 !, rider 按 alt+enter 生成 的 實現代碼 把他弄到 構造函數 下面了 ,導致 即使 有 dbset ,還是報這個錯 !
在更新 ,還是報這個錯的話 在 對應的 ef core module .cs 里面 加上 這個
再次更新 ,如果是引用別的模塊 的 IService 報 這個錯的話,就 是 要在
再再再更新
如果 appService 繼承了 CrudService ,然后 引用 別的模塊 的 IService 依賴注入 也可能報這個錯誤
這個時候 要在 對應 的模塊 里面 把 IService 注冊一下