【问题标题】:Adding Microsoft.AspNetCore.Identity.UI to .Net 6 Blazor Webassembly Shared project causes build Error将 Microsoft.AspNetCore.Identity.UI 添加到 .Net 6 Blazor Webassembly 共享项目导致构建错误
【发布时间】:2022-01-01 08:53:34
【问题描述】:

我需要将我的 ApplicationUser 类移动到我的 Blazor Webassembly .Net 6 的共享项目中,这样我就可以在我的其他共享对象中使用它。它需要对 Identity 的引用。

当我向共享项目添加对 Microsoft.AspNetCore.Identity.UI 的引用时,我收到以下错误:

错误 NETSDK1082 没有可用于指定 RuntimeIdentifier 'browser-wasm' 的 Microsoft.AspNetCore.App 运行时包。 WaterWithdrawl.Client C:\Program Files\dotnet\sdk\6.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets 427

我没有对 Visual Studio .Net 6 Blazor Assemble 模板进行任何更改

【问题讨论】:

  • 你不需要 UI,你只需要 Microsoft.AspNetCore.Identity.EntityFrameworkCore
  • 您不应将任何形式的 *.Identity 添加到共享项目中。低效且不安全。为用户使用 DTO。

标签: asp.net-identity identity blazor-webassembly .net-6.0


【解决方案1】:

共享项目中引用Identity不需要Microsoft.AspNetCore.Identity.UI,只需要Microsoft.AspNetCore.Identity.EntityFrameworkCore

【讨论】:

    猜你喜欢
    • 2020-09-25
    • 2013-10-19
    • 1970-01-01
    • 2020-09-10
    • 1970-01-01
    • 1970-01-01
    • 2017-04-16
    • 2021-06-16
    相关资源
    最近更新 更多