gpt4 book ai didi

c# - Blazor、ASP.NET Core 托管与 ASP.NET Core 中的服务器端

转载 作者:可可西里 更新时间:2023-11-01 07:56:50 25 4
gpt4 key购买 nike

我正在尝试使用 blazor.Net,这是一个实验性框架。

我已经在这个框架中开发了一个小项目,非常棒。

但在 11 月 14 日对 Blazor 语言服务进行了最近更新之后,我在模板选择中看到了两个选项。

enter image description here

首先是 Blazor(托管 ASP.NET Core)

其次是 Blazor(ASP.NET Core 中的服务器端)

没有关于它们之间区别的信息,

谁能告诉我这两个模板有什么区别,什么时候应该选择哪个?

最佳答案

我认为接受的答案并没有像其中一条评论中提到的 Mike-EEE 那样回答问题。

必要的信息可以在这个链接下找到: https://www.telerik.com/blogs/a-breakdown-of-blazor-project-types

The Blazor Full-Stack template encompasses the same project structure as the Client-Side template with a few additions. Just like the Client-Side template there is no HTML rendered by the server and all files are delivered to the client as static files including .NET binaries. The difference however is added ASP.NET Core hosting and Web API and a Shared project for common application logic.

该模板包括三个项目:客户端 Blazor 应用程序 Blazor.Client、ASP.NET Core 服务器应用程序 Blazor.Server 和用于通用应用程序逻辑 Blazor.Shared 的共享 .NET Standard 项目。

The Blazor Server-Side project template takes a significantly different approach to how a Blazor application is delivered and interacts with the browser. When using the server-side configuration Blazor utilizes the browser as a "thin-client" by deploying a SignalR JavaScript application to the client. On the server, Blazor implements a SignalR hub communicating with the client via web sockets. In the server-side hosting model, Blazor is executed on the server from within an ASP.NET Core app. UI updates, event handling, and JavaScript calls are handled over the SignalR connection. In this configuration there is no need for WebAssembly and Blazor is executed on the ASP.NET Core runtime at the server. All UI updates are sent as diffs, bidirectionally as binary packets over web sockets. To the user, the application is indistinguishable from any other web application.

关于c# - Blazor、ASP.NET Core 托管与 ASP.NET Core 中的服务器端,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53332097/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com