Hello
I'll facing a problem and i can't find the answer. I use a brand new NetCore/Angular that works fine. I add a WPF for prototyping (i'll already done this whith v 2.3 and it works fine) but raises exceptions as i access to ABp Code.
Here is what i have :
L'exception Castle.MicroKernel.Handlers.HandlerException s'est produite HResult=0x80131500 Message=Can't create component 'K2.Stratos.Authorization.Users.UserManager' as it has dependencies to be satisfied.
'K2.Stratos.Authorization.Users.UserManager' is waiting for the following dependencies:
- Service 'Microsoft.Extensions.Options.IOptions`1[[Microsoft.AspNetCore.Identity.IdentityOptions, Microsoft.Extensions.Identity.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]' which was not registered.
- Service 'Microsoft.AspNetCore.Identity.IPasswordHasher`1[[K2.Stratos.Authorization.Users.User, K2.Stratos.Core, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null]]' which was not registered.
- Service 'System.Collections.Generic.IEnumerable
1[[Microsoft.AspNetCore.Identity.IUserValidator
1[[K2.Stratos.Authorization.Users.User, K2.Stratos.Core, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null]], Microsoft.Extensions.Identity.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]' which was not registered. - Service 'System.Collections.Generic.IEnumerable
1[[Microsoft.AspNetCore.Identity.IPasswordValidator
1[[K2.Stratos.Authorization.Users.User, K2.Stratos.Core, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null]], Microsoft.Extensions.Identity.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]' which was not registered. - Service 'Microsoft.AspNetCore.Identity.ILookupNormalizer' which was not registered.
- Service 'Microsoft.AspNetCore.Identity.IdentityErrorDescriber' which was not registered.
- Service 'System.IServiceProvider' which was not registered.
- Service 'Microsoft.Extensions.Logging.ILogger`1[[K2.Stratos.Authorization.Users.UserManager, K2.Stratos.Core, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null]]' which was not registered.
- Service 'K2.Stratos.Authorization.Roles.RoleManager' which was registered but is also waiting for dependencies. 'K2.Stratos.Authorization.Roles.RoleManager' is waiting for the following dependencies:
- Service 'System.Collections.Generic.IEnumerable
1[[Microsoft.AspNetCore.Identity.IRoleValidator
1[[K2.Stratos.Authorization.Roles.Role, K2.Stratos.Core, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null]], Microsoft.Extensions.Identity.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]' which was not registered. - Service 'Microsoft.AspNetCore.Identity.ILookupNormalizer' which was not registered.
- Service 'Microsoft.AspNetCore.Identity.IdentityErrorDescriber' which was not registered.
- Service 'Microsoft.Extensions.Logging.ILogger`1[[K2.Stratos.Authorization.Roles.RoleManager, K2.Stratos.Core, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null]]' which was not registered.
I boostraped the app with this code public App() {
_bootstrapper = AbpBootstrapper.Create<ProtoModule>();
//_bootstrapper.IocManager.IocContainer.AddFacility<LoggingFacility>(f => f.UseAbpLog4Net()
// .WithConfig("log4net.config"));
}
protected override async void OnStartup(StartupEventArgs e)
{
_bootstrapper.Initialize();
// await Proto.CurrentWebServer.ConnectAsync();
}
protected override void OnExit(ExitEventArgs e)
{
_bootstrapper.Dispose();
}
can you help me ?
Chris
11 Answer(s)
-
0
Check that you called RegisterAssemblyByConvention:
[DependsOn(typeof(ProtoDataModule), typeof(ProtoApplicationModule))] public class ProtoModule : AbpModule { public override void Initialize() { IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly()); } }
-
0
Yes i did it like this ... I re-checked all but no luck ...
[DependsOn( typeof(StratosEntityFrameworkCoreModule), typeof(StratosApplicationModule), typeof(SellsyModule), typeof(FreshServiceModule), typeof(StratosApplicationModule), typeof(StratosCoreModule))] public class ProtoModule : K2Module { public override void PreInitialize() { //Configuration.DefaultNameOrConnectionString = "Default"; IocManager.Register<IAbpSession, ProtoClaimSession>(); IocManager.Register<IStratosServer, StratosWebServer>(); } public override void Initialize() { IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly()); } }
-
0
Hi @ChEhrhard,
I think your problem is similar to <a class="postlink" href="https://github.com/aspnetboilerplate/module-zero/issues/376">https://github.com/aspnetboilerplate/mo ... issues/376</a>, can you check that ?
-
0
I tried but have an error :
Méthode introuvable : 'Castle.MicroKernel.Registration.ComponentRegistration
1<!0> Castle.MicroKernel.Registration.ComponentRegistration
1.UsingFactoryMethod(System.Converter`2<Castle.MicroKernel.IKernel,!!0>, Boolean)'.here's where i put the code ( i tried before and after then IoCManager.RegisterAsse....... line.
[DependsOn( typeof(StratosEntityFrameworkCoreModule), typeof(StratosApplicationModule), typeof(SellsyModule), typeof(FreshServiceModule), typeof(StratosApplicationModule), typeof(StratosCoreModule))] public class ProtoModule : K2Module { public override void PreInitialize() { //Configuration.DefaultNameOrConnectionString = "Default"; IocManager.Register<IAbpSession, ProtoClaimSession>(); IocManager.Register<IStratosServer, StratosWebServer>(); } public override void Initialize() { IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly()); var services = new ServiceCollection(); IdentityRegistrar.Register(services); WindsorRegistrationHelper.CreateServiceProvider(IocManager.IocContainer, services); } }
-
0
Can you show the full stack trace?
-
0
Here you have
à Castle.Windsor.MsDependencyInjection.WindsorRegistrationHelper.RegisterServiceDescriptor(IWindsorContainer container, ServiceDescriptor serviceDescriptor) à Castle.Windsor.MsDependencyInjection.WindsorRegistrationHelper.CreateServiceProvider(IWindsorContainer container, IServiceCollection services) à K2.Stratos.Wpf.Logic.ProtoModule.Initialize() dans C:\EhciDev\K2\Stratos\test\K2.Stratos.Wpf\Logic\ProtoModule.cs:ligne 39 à Abp.Modules.AbpModuleManager.<>c.<StartModules>b__15_1(AbpModuleInfo module) à System.Collections.Generic.List
1.ForEach(Action
1 action) à Abp.Modules.AbpModuleManager.StartModules() à Abp.AbpBootstrapper.Initialize() -
0
ComponentRegistration.UsingFactoryMethod was modified in Castle.Windsor v4.0.0 and WindsorRegistrationHelper.cs is interpreted as passing in a Converter instead of Func. This might have to be fixed on Volosoft's side, so hang on.
-
0
ok thanks for the answer. I hang on .. any idea of a timing ?
is there a workaround in the meantime ?
-
0
Can you check that you are using v2.1.1/v3.0.0 of Castle.Windsor.MsDependencyInjection nuget package?
-
0
I use v3.0 .
-
0
Hi @ChEhrhard,
Which version of Castle.Core and Castle.Windsor do you use in your project ? If your project does not contain confidential information, you can send your project to us and let us check it.
Thanks.