简体   繁体   English

为什么客户端 Blazor 使用 .NET Standard 2.0 以及如何将 .NET Core 3.0 与 Blazor 一起使用?

[英]Why is client-side Blazor using .NET Standard 2.0 and how to use .NET Core 3.0 with Blazor?

Is it possible to use .NET Core 2.2 or 3.0 with Blazor?是否可以将 .NET Core 2.2 或 3.0 与 Blazor 一起使用?

Because at this moment, the blazorhosted template creates a client-side project as .NET Standard which prevents using .NET Core 3.0.因为此时, blazorhosted模板会创建一个客户端项目作为 .NET Standard,这会阻止使用 .NET Core 3.0。

Project blazor.Shared is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Project blazor.Shared 与 netstandard2.0 (.NETStandard,Version=v2.0) 不兼容。 Project blazor.Shared supports: netcoreapp3.0 (.NETCoreApp,Version=v3.0) blazor.Client C:\\app\\blazor.Client\\blazor.Client.csproj 1 blazor.Shared 项目支持:netcoreapp3.0 (.NETCoreApp,Version=v3.0) blazor.Client C:\\app\\blazor.Client\\blazor.Client.csproj 1

After changing everything to .NET Core 3.0, I get the following error:将所有内容更改为 .NET Core 3.0 后,出现以下错误:

rzc generate exited with code 1. rzc 生成以代码 1 退出。

So, is it possible and I'm doing something wrong or is there no way yet?那么,有可能吗,我做错了什么还是没有办法?

Client side Blazor runs on the Mono WASM runtime, and that only supports netstandard 2.0 ATM.客户端 Blazor 在 Mono WASM 运行时上运行,并且仅支持 netstandard 2.0 ATM。 The announcement of Blazor in Core refers to server side Blazor.在 Core 中宣布 Blazor 是指服务器端 Blazor。 The two are compatible code wise but the underlaying runtime technique is totally different.两者在代码方面是兼容的,但底层运行时技术完全不同。

Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation does not work on blazor because it requires .NET 3.0 Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation在 blazor 上不起作用,因为它需要 .NET 3.0

As a result it requires a recompile manually every time I make a change which is slow when debugging.因此,每次我进行更改时都需要手动重新编译,这在调试时很慢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM