为什么使用服务器端 Blazor 的解决方案中有两个项目
Why two projects in a solution with server-side Blazor
当创建一个新的服务器端 Blazor 项目时,您实际上会在一个解决方案中获得两个项目。为什么是这样?我想它与文档中这张图表所示的架构有关?因此换句话说,必须使用 .NET 核心进程来托管 Blazor 应用程序。这是基本的想法吗?换句话说,IIS 将提供 .NET 核心应用程序,后者又 "serves" 提供 Blazor 应用程序,或者类似的东西?
根据 "ASP.NET Core updates in .NET Core 3.0 Preview 2" 博客文章...
https://blogs.msdn.microsoft.com/webdev/2019/01/29/aspnet-core-3-preview-2/
Why two projects? In part it's to separate the UI logic from the rest of the application. There is also a technical limitation in this preview that we are using the same Razor file extension (.cshtml) for Razor Components that we also use for Razor Pages and Views, but they have different compilation models, so they need to kept separate. In a future preview we plan to introduce a new file extension for Razor Components (.razor) so that you can easily host your components, pages, and views all in the same project.
当创建一个新的服务器端 Blazor 项目时,您实际上会在一个解决方案中获得两个项目。为什么是这样?我想它与文档中这张图表所示的架构有关?因此换句话说,必须使用 .NET 核心进程来托管 Blazor 应用程序。这是基本的想法吗?换句话说,IIS 将提供 .NET 核心应用程序,后者又 "serves" 提供 Blazor 应用程序,或者类似的东西?
根据 "ASP.NET Core updates in .NET Core 3.0 Preview 2" 博客文章...
https://blogs.msdn.microsoft.com/webdev/2019/01/29/aspnet-core-3-preview-2/
Why two projects? In part it's to separate the UI logic from the rest of the application. There is also a technical limitation in this preview that we are using the same Razor file extension (.cshtml) for Razor Components that we also use for Razor Pages and Views, but they have different compilation models, so they need to kept separate. In a future preview we plan to introduce a new file extension for Razor Components (.razor) so that you can easily host your components, pages, and views all in the same project.