C# 在blazor应用程序中使用意外名称标记?

C# 在blazor应用程序中使用意外名称标记?,c#,authentication,authorization,blazor,C#,Authentication,Authorization,Blazor,正在尝试在我的blazor web assembly应用程序中建立用户帐户并构建身份验证元素 但是,有两个组件存在错误: Found markup element with unexpected name 'xxxxxxxxxxxxxxxx' 两个有问题的组件是AuthorizeRouteView和CascadingAuthenticationState 我的代码: <Router AppAssembly="@typeof(Program).Assembly"> <F

正在尝试在我的blazor web assembly应用程序中建立用户帐户并构建身份验证元素

但是,有两个组件存在错误:

Found markup element with unexpected name 'xxxxxxxxxxxxxxxx'
两个有问题的组件是AuthorizeRouteView和CascadingAuthenticationState

我的代码:

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

对不起,这个地址什么也没有


有什么可能出错的线索吗

尝试以下设置。请注意,在NotAuthorized属性元素中有一个名为RedirectToLogin的元素。这是您应该定义的Razor组件的名称(RedirectToLogin.Razor文件名),可能需要在_Imports.Razor文件中更新其命名空间(例如:@using OpenIDConnectSample.Shared)


等待
对不起,这个地址什么也没有


尝试以下设置。请注意,在NotAuthorized属性元素中有一个名为RedirectToLogin的元素。这是您应该定义的Razor组件的名称(RedirectToLogin.Razor文件名),可能需要在_Imports.Razor文件中更新其命名空间(例如:@using OpenIDConnectSample.Shared)


等待
对不起,这个地址什么也没有


你检查过这个吗?yassas@AthanasiosKataras我检查过这个,但我的问题仍然存在,没有人建议解决我的问题:(尝试重新启动VS-有时只是工具错误你检查过这个吗?yassas@AthanasiosKataras我检查过这个,但我的问题仍然存在,也没有人建议解决我的问题:(尝试重新启动VS-有时只是工具错误
<CascadingAuthenticationState>
    <Router AppAssembly="@typeof(Program).Assembly">
        <Found Context="routeData">
            <AuthorizeRouteView RouteData="@routeData" 
                             DefaultLayout="@typeof(MainLayout)">
                <NotAuthorized>
                    <RedirectToLogin />
                </NotAuthorized>
                <Authorizing>
                    Wait...
                </Authorizing>
            </AuthorizeRouteView>
        </Found>
        <NotFound>
            <LayoutView Layout="@typeof(MainLayout)">
                <p>Sorry, there's nothing at this address.</p>
            </LayoutView>
        </NotFound>
    </Router>
</CascadingAuthenticationState>