How do i fix Blazor webassembly 3.2.0 preview 2 update issue in app.razor?

mko

I have updated my Blazor web assembly app to the latest 3.2.0 preview 2 and I cannot resolve this error in App.razor

Error is pretty straightforward, NewLayout1 cannot be found. It exists, it inherits LayoutComponentBase but for some reason App.razor doesn't see it.

What can I do to fix this?

<Router AppAssembly="@typeof(Program).Assembly">
    <Found Context="routeData">
        <RouteView RouteData="@routeData" DefaultLayout="@typeof(NewLayout1)" />
    </Found>
    <NotFound>
        <LayoutView Layout="@typeof(NewLayout1)">
            <p>Sorry, there's nothing at this address.</p>
        </LayoutView>
    </NotFound>
</Router>

The type or namespace name 'NewLayout1' could not be found (are you missing a using directive or an assembly reference?)

Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type\Debug\netstandard2.1\Razor\App.razor.g.cs

__builder.AddAttribute(2, "Found", (Microsoft.AspNetCore.Components.RenderFragment<Microsoft.AspNetCore.Components.RouteData>)((routeData) => (__builder2) => {
                __builder2.AddMarkupContent(3, "\r\n        ");
                __builder2.OpenComponent<Microsoft.AspNetCore.Components.RouteView>(4);
                __builder2.AddAttribute(5, "RouteData", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<Microsoft.AspNetCore.Components.RouteData>(
#nullable restore
#line 3 "C:\Users\Source\Repos\Admin.Blazor.Client\Admin.UI\Client\App.razor"
                               routeData

#line default
#line hidden
#nullable disable
                ));
                __builder2.AddAttribute(6, "DefaultLayout", Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.Type>(
#nullable restore
#line 3 "C:\Users\\Source\Repos\Admin.Blazor.Client\Admin.UI\Client\App.razor"
                                                          typeof(NewLayout1)

#line default
#line hidden
#nullable disable
                ));
                __builder2.CloseComponent();
                __builder2.AddMarkupContent(7, "\r\n    ");
            }
            ));
Inktkiller

What is the namespace of NewLayout1 ?

Try setting@namespace Admin.UI in your NewLayout1 component.

And make sure @using Admin.UI is set in _Imports.razor

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Blazor WebAssembly site gives 404 after updating to 3.2.0 Preview 2

How can I use Azure AD B2C to authenticate users on the server before serving a hosted Blazor WebAssembly app?

Blazor Preview 9 Issue with Logger in Razor Layout

How can I fix below issue when host blazor app to windows server?

How do I authenticate a user in serverside controller in a blazor webassembly project?

How do I implement OIDC authentication in Blazor WebAssembly?

How do I use Bootstrap Icons in C# Blazor WebAssembly?

How can I reach body tag or another tag from Razor Page in Blazor WebAssembly?

How do I run my flutter app in dart v2 mode in debug in VS Code (--preview-dart-2 option)

Unable to Override <NotAuthorized> in Blazor WebAssembly from app.razor

Blazor WebAssembly JSInvokable Binding - how to update screen?

How do I fix or get rid of ESLint definition requirement in ASP.NET Razor app?

How to fix " 3*10**(0) + 8*10**(-1) + 5*10**(-2) + 2*10**(-3) do not equal 3.852 "?

How to fix the following issue with razor?

How to change the favicon in Blazor webassembly app?

How can I fix an issue on a Python Flask app on ec2 only where data from a table in database won't display?

Can I run ARCore Preview 1 App on Preview 2 release?

How to get current username in Razor page of Blazor WebAssembly?

Android studio 2 issue after update to preview 6

How do I fix this issue where my 2D array won't output it's values in C++?

how do I fix the type mismatch issue?

How do I fix this AuthStateListener issue

How do I fix this dependency issue in Clojure?

How do I fix the conditional dropdown issue

How do I fix margin issue in CSS?

How do i fix this <a href> issue?

How do I fix a Flutter for Android issue?

how do i fix this array issue?

Issue with coding, how do I fix this?