Open Closed

Overwrite LeptonX component does not work #4064


User avatar
0
ageiter created
  • ABP Framework version: v6.0.1
  • UI type: Blazor Server
  • DB provider: EF Core
  • Exception message and stack trace:
System.ArgumentException: The type 'MyProject.Blazor.Components.Layout.MyMainHeaderToolbar' is not assignable to service 'Volo.Abp.AspNetCore.Components.Web.LeptonXTheme.Components.ApplicationLayout.TopMenu.MainHeader.MainHeaderToolbar'.
   at Autofac.Builder.RegistrationBuilder.CreateRegistration(Guid id, RegistrationData data, IInstanceActivator activator, IResolvePipelineBuilder pipelineBuilder, Service[] services, IComponentRegistration target)
   at Autofac.Builder.RegistrationBuilder.CreateRegistration[TLimit,TActivatorData,TSingleRegistrationStyle](IRegistrationBuilder`3 builder)
   at Autofac.Builder.RegistrationBuilder.RegisterSingleComponent[TLimit,TActivatorData,TSingleRegistrationStyle](IComponentRegistryBuilder cr, IRegistrationBuilder`3 builder)
   at Autofac.ContainerBuilder.Build(IComponentRegistryBuilder componentRegistry, Boolean excludeDefaultModules)
   at Autofac.ContainerBuilder.Build(ContainerBuildOptions options)
   at Volo.Abp.Autofac.AbpAutofacServiceProviderFactory.CreateServiceProvider(ContainerBuilder containerBuilder)
   at Microsoft.Extensions.Hosting.Internal.ServiceFactoryAdapter`1.CreateServiceProvider(Object containerBuilder)
   at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
   at Microsoft.Extensions.Hosting.HostBuilder.Build()
   at Microsoft.AspNetCore.Builder.WebApplicationBuilder.Build()
   at MyProject.Blazor.Program.Main(String[] args) in D:\Projects\MyProject\src\MyProject.Blazor\Program.cs:line 65
  • Steps to reproduce the issue:" I followed the instructions according to the documentation (https://docs.abp.io/en/commercial/latest/themes/lepton-x/blazor?UI=BlazorServer)
  1. Created Razor page MyMainHeaderToolbar.razor (the only content is @Name)
  2. Added MyMainHeaderToolbar.razor.cs with the following content:
using Volo.Abp.AspNetCore.Components.Web.LeptonXTheme.Components.ApplicationLayout.TopMenu.MainHeader;
using Volo.Abp.DependencyInjection;

namespace MyProject.Blazor.Components.Layout
{
    [ExposeServices(typeof(MainHeaderToolbar))]
    [Dependency(ReplaceServices = true)]
    public partial class MyMainHeaderToolbar
    {
        public string Name = "My Main Header Toolbar";
    }
}

Does this still need to be registered somewhere?


2 Answer(s)
  • User Avatar
    0
    ageiter created

    Would be great if I could get an answer on this topic. Thank you.

  • User Avatar
    0
    joe@tronactive.com created

    I am having the same issues. Any ideas?

Made with ❤️ on ABP v8.3.0-preview Updated on July 04, 2024, 07:07