简体   繁体   English

创建 Blazor 应用程序时,在什么情况下我会选择“ASP.NET Core 托管”?

[英]When creating a Blazor application, in what cases would I select "ASP.NET Core hosted"?

Here's the prompt that I see in Visual Studio:这是我在 Visual Studio 中看到的提示:

在此处输入图片说明

In what cases should I check the box that says "ASP.NET Core hosted"?在什么情况下我应该选中“ASP.NET Core 托管”框?

I would like to follow the client-side model here (no SignalR), and my intent is to right-click-publish to an Azure App Service.我想在这里遵循客户端模型(没有 SignalR),我的目的是右键单击发布到 Azure 应用服务。

... to right-click-publish to an Azure App Service. ... 右键单击​​发布到 Azure 应用服务。

Means you want to use a service (providing an API backend).意味着您要使用服务(提供 API 后端)。

In that case the "Hosted" template is the ideal starter kit.在这种情况下,“托管”模板是理想的入门工具包。 It essentially is two projects in one: an independent SPA application and an API Service.它本质上是两个项目合二为一:一个独立的 SPA 应用程序和一个 API 服务。

But do note that you could develop those two independently as well.但请注意,您也可以独立开发这两个。

When you don't need/want a service then simply don't check the "Hosted" option.当您不需要/想要一项服务时,请不要选中“托管”选项。 And then there is no need for an App service to deploy to.然后不需要部署应用程序服务。

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

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