【发布时间】:2020-02-08 17:21:10
【问题描述】:
我的 App.razor 出现此错误:
找到具有意外名称的标记元素 '级联身份验证状态'。如果这是一个组件, 为其命名空间添加@using 指令
这是我正在使用的代码
<CascadingAuthenticationState>
<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
</Found>
<NotFound>
<LayoutView Layout="@typeof(MainLayout)">
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
</CascadingAuthenticationState>
我正在使用 Visual Studio 2019 预览版,我可以运行应用程序,但是为什么我在 Cascading 中出现红线......?
【问题讨论】:
-
该代码本身没问题,您可能使用了错误的软件包。确保您是最新的 3.0 发布版本。对于现有项目,请遵循更新指南。
-
@HenkHolterman 您能否指出要为该错误安装什么软件包?
-
但我现在看到了客户端标签。您发布的 App.razor 用于服务器端。
-
但它在客户端。自上次更新以来,我无法再运行它了。在我的最后一次工作中,在最后一次更新之前,我能够毫无问题地运行。
-
先生最新的什么包?