Activities of "mahuwei"

Question

Maui blazor 项目: program:

public static class MauiProgram {
    public static MauiApp CreateMauiApp() {
        var builder = MauiApp.CreateBuilder();
        builder
            .UseMauiApp<App>()
            .ConfigureFonts(fonts => {
                fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
            });

        builder.Services.AddMauiBlazorWebView();
        ConfigureConfiguration(builder);

        builder.Services.AddApplication<KkdQueuingServiceMauiModule>(options => {
            options.Services.ReplaceConfiguration(builder.Configuration);
            options.UseAutofac();
        });

#if DEBUG
        builder.Services.AddBlazorWebViewDeveloperTools();
        builder.Logging.AddDebug();
#endif
        var app = builder.Build();
        var abpApplication = app.Services.GetRequiredService<IAbpApplicationWithExternalServiceProvider>();
        abpApplication.Initialize(app.Services);
        return app;
    }

    private static void ConfigureConfiguration(MauiAppBuilder builder) {
        var assembly = typeof(App).GetTypeInfo().Assembly;
        builder.Configuration.AddJsonFile(new EmbeddedFileProvider(assembly), "appsettings.json", false, false);
        builder.Configuration.AddJsonFile(new EmbeddedFileProvider(assembly), "appsettings.secrets.json", true, false);
    }
}

module:

[DependsOn(typeof(AbpAutofacModule),
    typeof(AbpAutoMapperModule),
    typeof(AbpAspNetCoreMvcClientCommonModule),
    typeof(AbpAspNetCoreComponentsWebModule),
    typeof(AbpIdentityProDomainSharedModule),
    typeof(AbpIdentityHttpApiClientModule),
    typeof(QueuingServiceHttpApiClientModule),
    typeof(AbpHttpClientIdentityModelModule))]
public class KkdQueuingServiceMauiModule : AbpModule {
    public override void ConfigureServices(ServiceConfigurationContext context) {
        context.Services.AddBlazorWebView();

        context.Services.AddTransient<IRemoteServiceHttpClientAuthenticator, KkdRemoteServiceHttpClientAuthenticator>();

        ConfigureAutoMapper();
        base.ConfigureServices(context);
    }

    private void ConfigureAutoMapper() {
        Configure<AbpAutoMapperOptions>(options => {
            options.AddMaps<KkdQueuingServiceMauiModule>();
        });
    }
}

调用:

@page "/counter"
@using Kkd.QueuingService.Commodities
@using Volo.Abp.DependencyInjection
@inject ICommoditiesAppService CommoditiesAppService
@inject IAbpLazyServiceProvider LazyServiceProvider

@code {
    private int _currentCount;

    private void IncrementCount() {
        _currentCount++;
    }

    private async Task GetCommoditiesAsync() {
        try {
            var tenantId = new Guid("3a1a22c2-ccbb-3f27-da9d-6e69edade96b");
            var getCommoditiesInput = new GetCommoditiesInput();
            // 出错代码
            var commodities = await CommoditiesAppService.GetListByTenantAsync(tenantId, getCommoditiesInput);
            Console.WriteLine($"Commodities count: {commodities.Count}");
        }
        catch (Exception ex) {
            Console.WriteLine($"Error fetching commodities: {ex.Message}");
        }
    }

}
  • Exception message and full stack trace:
  • System.NullReferenceException HResult=0x80004003 Message=Object reference not set to an instance of an object. Source=Volo.Abp.Http.Client StackTrace: 在 Volo.Abp.Http.Client.ClientProxying.ClientProxyBase`1.get_ClientOptions() 在 Volo.Abp.Http.Client.ClientProxying\ClientProxyBase.cs 中: 第 44 行

  • Steps to reproduce the issue:

当前系统abp版本信息: 如何使用ABP Studio或abp cli新建8.3.4的项目?

  • Exception message and full stack trace:
  • Steps to reproduce the issue:

How to use ABP Commercial in MaUI Blazor?

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v5.2.0
  • UI type: Blazor wasm
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • blazor ui:
Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
     Unhandled exception rendering component: Unable to set property 'Color' on object of type 'Blazorise.Bootstrap5.Button'. The error was: Specified cast is not valid.
System.InvalidOperationException: Unable to set property 'Color' on object of type 'Blazorise.Bootstrap5.Button'. The error was: Specified cast is not valid.
---> System.InvalidCastException: Specified cast is not valid.
  at Microsoft.AspNetCore.Components.Reflection.PropertySetter.CallPropertySetter[Button,Color](Action`2 setter, Object target, Object value)
  at Microsoft.AspNetCore.Components.Reflection.PropertySetter.SetValue(Object target, Object value)
  at Microsoft.AspNetCore.Components.Reflection.ComponentProperties.&lt;SetProperties&gt;g__SetProperty|3_0(Object target, PropertySetter writer, String parameterName, Object value)
  --- End of inner exception stack trace ---
  at Microsoft.AspNetCore.Components.Reflection.ComponentProperties.&lt;SetProperties&gt;g__SetProperty|3_0(Object target, PropertySetter writer, String parameterName, Object value)
  at Microsoft.AspNetCore.Components.Reflection.ComponentProperties.SetProperties(ParameterView& parameters, Object target)
  at Microsoft.AspNetCore.Components.ParameterView.SetParameterProperties(Object target)
  at Microsoft.AspNetCore.Components.ComponentBase.SetParametersAsync(ParameterView parameters)
  at Blazorise.BaseComponent.SetParametersAsync(ParameterView parameters)
  at Microsoft.AspNetCore.Components.Rendering.ComponentState.SupplyCombinedParameters(ParameterView directAndCascadingParameters)

  • Steps to reproduce the issue:"
Showing 1 to 4 of 4 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 18, 2025, 07:10