http://xiangai.taobao.com
http://shop148612228.taobao.com

;Castle.MicroKernel.ComponentNotFoundException: No component for supporting the service ****** was found

;Castle.MicroKernel.ComponentNotFoundException: No component for supporting the service ****** was found
在 Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, Arguments arguments, IReleasePolicy policy, Boolean ignoreParentContext)
在 Castle.MicroKernel.DefaultKernel.Resolve(Type service, Arguments arguments)
在 Castle.Windsor.WindsorContainer.Resolve[T]()
在 Abp.Dependency.IocManager.Resolve[T]() 位置 D:\Github\aspnetboilerplate\src\Abp\Dependency\IocManager.cs:行号 179
在 Abp.Dependency.IocResolverExtensions.ResolveAsDisposable[T](IIocResolver iocResolver) 位置 D:\Github\aspnetboilerplate\src\Abp\Dependency\IocResolverExtensions.cs:行号 18

Castle.MicroKernel.ComponentNotFoundException
HResult=0x80131500
Message=No component for supporting the service was found
Source=Castle.Windsor
StackTrace:
at Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, Arguments arguments, IReleasePolicy policy, Boolean ignoreParentContext)
at Castle.MicroKernel.DefaultKernel.Resolve(Type service, Arguments arguments)
at Castle.Windsor.WindsorContainer.Resolve[T]()
at Abp.Dependency.IocManager.Resolve[T]()
at Abp.Dependency.IocResolverExtensions.ResolveAsDisposable[T](IIocResolver iocResolver)

 


解决方法:

using (var bootstrapper = AbpBootstrapper.Create<OrderServiceModule>())
{
//bootstrapper.IocManager
// .IocContainer
// .AddFacility<LoggingFacility>(f => f.UseLog4Net().WithConfig("log4net.config"));
bootstrapper.IocManager.IocContainer.AddFacility<LoggingFacility>(f => f.UseAbpLog4Net().WithConfig(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log4net.config")));

//初始化之后再使用
bootstrapper.Initialize();

//你的业务逻辑

}

 

posted @ 2021-07-23 16:33  万事俱备就差个程序员  阅读(641)  评论(0编辑  收藏  举报

http://xiangai.taobao.com
http://shop148612228.taobao.com
如果您觉得对您有帮助.领个红包吧.谢谢.
支付宝红包
微信打赏 支付宝打赏