bitshift
bitshift

Reputation: 6872

Why two projects in a solution with server-side Blazor

When one creates a new server-side Blazor project, you actually get two projects within a solution. Why is this? I suppose it has something to do with the architecture as shown in this diagram from the docs? So in other words, a .NET core process must be used to host the Blazor app. Is that the basic idea? In other words, IIS would serve up the .NET core app, which in turn "serves" up the Blazor app, or something to that effect?

enter image description here

Upvotes: 0

Views: 1044

Answers (1)

Raymond Wong
Raymond Wong

Reputation: 312

According to "ASP.NET Core updates in .NET Core 3.0 Preview 2" blog article...

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.

Upvotes: 1

Related Questions