How to add _host.cshtml file to Razor pages project

Viewed 1409

I have followed this tutorial and I am Using Razor Components In A Razor Page. I execute razor components in a razor page using

@(await Html.RenderComponentAsync<WEKA.Components.Sortiment>(RenderMode.Server))

which works OK.

But every package (e.g. matBlazor) I am trying to use wants me to modify _host.cshtml file. I do not have such a file in my ASP.NET Core 3.0 Razor pages project - it is a file for routing within Blazor app - not sure where to put it in Razor pages project and what it should contain.

Anyone can give me a hint about that?


I found out simply by trying (I am new to this and did not study the background) that when I modify _layout.cshtml instead of _host.cshtml and add an empty _host.cshtml file to Pages folder, after that matBlazor starts to work OK.

0 Answers
Related