asp.net-core - 为什么 blazor dotnet core 3.1 webassembly 客户端和共享项目是 netstandard 2.1?

标签 asp.net-core blazor asp.net-core-3.1

在 core3.1 中创建了 blazor web assembly 客户端和服务器端,当项目创建时我们有 3 个相关项目,

  • 服务器项目=> netcoreapp3.1

  • 客户端项目 => netstandard2.1

  • 共享项目=> netstandard2.1

为什么另外两个项目都是netstandard2.1?我需要从 netstandard2.1 更改为 core3.1。

为什么客户端和共享项目是 netstandard2.1?我可以换成netcore3.1吗?

最佳答案

.net-core 3.x 是 .net-standard 2.x 的超集。

服务器项目需要是 .net core,因为那是 asp.net core 所需要的。

Blazor/Wasm 在子集 .net-standard 上运行,即便如此,它也会为浏览器中不可用的功能抛出 NotSuportedException。就像一个简单的 File.ReadAllText()

在 .net-core 中实现 Blazor 需要对 Mono 进行更改,并且只会导致更多空洞的 promise 。它必须适合浏览器的“沙盒”环境。

I need a change from netstandard2.1 to core3.1.

解释为什么(您认为)您需要它。这就是真正的问题所在,也许是解决方案。

can I change to netcore3.1?

没有。

关于asp.net-core - 为什么 blazor dotnet core 3.1 webassembly 客户端和共享项目是 netstandard 2.1?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62024610/

相关文章:

iis - IIS下ASP.NET Core随机重启

c# - 通过 Entity Framework Core 将多个数据库连接到 .NET Core 项目

validation - 使用子组件时,Blazor EditForm 验证不起作用

c# - 在 Visual Studio 2019 中设置但尚未绑定(bind)的断点

c# - 如何在 .Net Core 中根据环境控制 appsettings.json 部署

asp.net - 使用 IdentityServer4 动态添加 SSO 步骤

c# - ASP.NET MVC 6(ASP.NET Core 或 ASP.NET5)中的友好 URL

radio-button - 如何将单选按钮绑定(bind)到枚举属性?

c# - Blazor onclick 事件未触发

c# - 如何在 Controller 中使用多个 DBContext