DbSet 不加访问修饰符,调用接口会出现如下的问题:

2021-05-18 14:43:17.937 +08:00 [ERR] An exception was thrown while activating Castle.Proxies.MiniProgramAppServiceProxy.
Autofac.Core.DependencyResolutionException: An exception was thrown while activating Castle.Proxies.MiniProgramAppServiceProxy.
---> Autofac.Core.DependencyResolutionException: None of the constructors found with 'Volo.Abp.Autofac.AbpAutofacConstructorFinder' on type 'Castle.Proxies.MiniProgramAppServiceProxy' can be invoked with the available services and parameters:
Cannot resolve parameter 'Volo.Abp.Domain.Repositories.IRepository`2[Wechat.Dung.Beetle.WeChatManagement.MiniPrograms.MiniProgram,System.Guid] repositoryMiniProgram' of constructor 'Void .ctor(Castle.DynamicProxy.IInterceptor[], Volo.Abp.Domain.Repositories.IRepository`2[Wechat.Dung.Beetle.WeChatManagement.MiniPrograms.MiniProgram,System.Guid])'.
at Autofac.Core.Activators.Reflection.ReflectionActivator.GetAllBindings(ConstructorBinder[] availableConstructors, IComponentContext context, IEnumerable`1 parameters)
at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
at Autofac.Core.Activators.Reflection.ReflectionActivator.<ConfigurePipeline>b__11_0(ResolveRequestContext ctxt, Action`1 next)
at Autofac.Core.Resolving.Middleware.DisposalTrackingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
at Autofac.Builder.RegistrationBuilder`3.<>c__DisplayClass41_0.<PropertiesAutowired>b__0(ResolveRequestContext ctxt, Action`1 next)
at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
--- End of inner exception stack trace ---
at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
at Autofac.Builder.RegistrationBuilder`3.<>c__DisplayClass35_0.<OnPreparing>b__0(ResolveRequestContext ctxt, Action`1 next)
at Autofac.Core.Resolving.Middleware.CoreEventMiddleware.Execute(ResolveRequestContext context, Action`1 next)
at Autofac.Core.Resolving.Middleware.SharingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
at Autofac.Core.Resolving.Middleware.CircularDependencyDetectorMiddleware.Execute(ResolveRequestContext context, Action`1 next)
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, ResolveRequest request)
at Autofac.Core.Resolving.ResolveOperation.ExecuteOperation(ResolveRequest request)
at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance)
at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
at Microsoft.AspNetCore.Mvc.Controllers.ServiceBasedControllerActivator.Create(ControllerContext actionContext)
at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass5_0.<CreateControllerFactory>g__CreateController|0(ControllerContext controllerContext)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
2021-05-18 14:43:17.990 +08:00 [ERR] ---------- Exception Data ----------
ActivatorChain = Castle.Proxies.MiniProgramAppServiceProxy

实体类映射逐一排查、网上搜索说有可能没有加DbSet导致的,后来排查有加DbSet,只是没有访问修饰符,怀疑是这个原因导致的,加上问题解决,特此记录,避免后续踩坑

上次的这个原因是因为实体类与Dto映射的字段类型不匹配导致的。

 

最后加上访问修饰符
public DbSet<MiniProgram> MiniPrograms { get; set; }

 

 
posted @ 2021-05-18 16:10 SharkLock 阅读(4099) 评论(0) 推荐(0) 编辑
摘要: 如果还是不OK,删除Platform和Plugins两个目录,重新添加下平台试试。 参考链接:https://stackoverflow.com/questions/31310182/error-could-not-find-gradle-wrapper-within-android-sdk-mig 阅读全文
posted @ 2017-09-19 14:56 SharkLock 阅读(370) 评论(0) 推荐(0) 编辑
摘要: 1、重装NodeJS 2、配置NodeJS全局和缓存路径 npm config set prefix “D:\Program Files\npm\node_global” npm config set cache “D:\Program Files\npm\node_cache” 3、配置环境变量 阅读全文
posted @ 2017-07-03 13:48 SharkLock 阅读(7916) 评论(1) 推荐(1) 编辑
摘要: 程序包管理器控制台执行命令(稳定版1.1):Install-Package Microsoft.EntityFrameworkCore.Tools EntityFramework6及以上版本执行命令:EntityFramework\Add-Migration "InitialCreate" Enti 阅读全文
posted @ 2017-06-16 17:49 SharkLock 阅读(3199) 评论(0) 推荐(1) 编辑
摘要: JQUERY写法: $(window).bind('beforeunload', function (e) { var isEdit = '<%=FormMastPage.ViewMode%>'; if (window.is_confirm !== false && isEdit == Enumer 阅读全文
posted @ 2017-04-17 13:53 SharkLock 阅读(8421) 评论(0) 推荐(0) 编辑
摘要: public class Barcode : IHttpHandler { private object _code = ""; private int _height = 52; private string code = ""; public void ProcessRequest(HttpContext context... 阅读全文
posted @ 2017-03-31 16:21 SharkLock 阅读(401) 评论(0) 推荐(0) 编辑
摘要: // 设置图像控件 Image image = new Image(); panel.IsEnabled = false; using (MemoryStream ms = new MemoryStream(item.AttachConnect)) { // var decoder = B... 阅读全文
posted @ 2015-11-25 11:43 SharkLock 阅读(1561) 评论(0) 推荐(0) 编辑
摘要: using IDOSSalesBizLogic;using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Wi... 阅读全文
posted @ 2015-03-09 15:15 SharkLock 阅读(530) 评论(0) 推荐(0) 编辑
摘要: --> 阅读全文
posted @ 2015-03-09 15:10 SharkLock 阅读(710) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using Microsoft.X... 阅读全文
posted @ 2014-10-28 10:27 SharkLock 阅读(752) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示