Elios Nur Scoglio
Elios Nur Scoglio

Reputation: 41

Maui Blazor Webview

Hello updating to the last version of maui with blazor web view give me this error:

System.Exception: 'Handler not found for view Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.'

here my init code:

   var builder = MauiApp.CreateBuilder();
    builder
        //.RegisterBlazorMauiWebView()
        .UseMauiApp<App>()
        .ConfigureFonts(fonts =>
        {
            fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
        });

    builder.Services.AddBlazorWebView();
 

TargetFrameworks:

<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows')) and '$(MSBuildRuntimeType)' == 'Full'">$(TargetFrameworks);net6.0-windows10.0.19041</TargetFrameworks>       
    

Upvotes: 2

Views: 1966

Answers (1)

Glimmer
Glimmer

Reputation: 21

You should update

builder.Services.AddBlazorWebView(); 

to

builder.Services.AddMauiBlazorWebView();

Upvotes: 2

Related Questions