Base solution for your next web application

Activities of "chehrhard"

Question

Hi

I use Core & Angular Zero

I unterstand that the default tenant Id should be 1. But if the first seedings fails, the Id will be 2, 3 or more.

To reproduce, try to add a Custom Builder and make it fail (on a newly created DB)

Is this a bug or am i false ?

Answer

ok, i unterstoud this. However, i spent a couple of hour to find this problem so, if this post can prevent others from wasting their time, I would be glad :) :)

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.IEnumerable1[[Microsoft.AspNetCore.Identity.IUserValidator1[[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.IEnumerable1[[Microsoft.AspNetCore.Identity.IPasswordValidator1[[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.IEnumerable1[[Microsoft.AspNetCore.Identity.IRoleValidator1[[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

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());
        }
    }

I tried but have an error :

Méthode introuvable : 'Castle.MicroKernel.Registration.ComponentRegistration1<!0> Castle.MicroKernel.Registration.ComponentRegistration1.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&lt;IAbpSession, ProtoClaimSession&gt;();
            IocManager.Register&lt;IStratosServer, StratosWebServer&gt;();
          
        }

        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());

            var services = new ServiceCollection();
            IdentityRegistrar.Register(services);
            WindsorRegistrationHelper.CreateServiceProvider(IocManager.IocContainer, services);
        }
    }

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.List1.ForEach(Action1 action) à Abp.Modules.AbpModuleManager.StartModules() à Abp.AbpBootstrapper.Initialize()

ok thanks for the answer. I hang on .. any idea of a timing ?

is there a workaround in the meantime ?

I use v3.0 .

Hi all

I've got a WPF application for prototyping. But since migration to v3.0 i've got an error at DB access

" ArgumentException: Format of the initialization string does not conform to specification starting at index 0."

Any Idea ? Here's the app.config sections used :

<connectionStrings>
    <add name="Default" connectionString="Server=*.*.*.*\sql_sauron; Database=K2Alpha; User id=sa ; password=****** ; MultipleActiveResultSets=true"  />
    
  </connectionStrings>

hi, the wildcards are only here for hidding the real address. The real code has the right address and the connection works with the .host project (with the same string).

Showing 1 to 10 of 17 entries