详细错误如下
无法使用可用服务和参数调用类型为“KMVC12.Controllers.HomeController”的“Autofac.Core.Activators.Reflection.DefaultConstructorFinder”的构造函数:无法解析构造函数的参数“KMVC12.Repositories.IPromotedContentRepository repository”无效.ctor(KMVC12.Repositories.IPromotedContentRepository,KMVC12.Repositories.IHomeRepository,KMVC12.Infrastructure.IOutputCacheDependencies)'。
已删除 builder.RegisterType 中的 set .PreserveExistingDefaults() ,这是我在一个解决方案中找到的
我在 DependencyResolverConfig.cs 文件中有以下代码,这是导致错误的原因吗?
builder.RegisterType<ContentItemMetadataProvider>()
.AsImplementedInterfaces()
.SingleInstance()
由于上述异常无法运行首页需要在前端无异常运行。