First experience with .NET8 Blazor’s Auto rendering mode

First experience with .NET8 Blazor’s Auto rendering mode After the release of .NET8, Blazor supports four rendering methods Static rendering, this kind of page can only be displayed, does not provide interaction, and can be used for web content display Using Blazor Server hosting through Server interaction Browser-side interaction using WebAssembly hosting Use Auto to automatically interact, initially using Blazor Server, and using WebAssembly to automatically perform interactive client rendering on subsequent visits. Auto-rendering generally provides the fastest app launch experience. Experience When creating a Blazor application through VS, select the new template Blazor Web App. During the process, you can see that there are four templates to choose from. We can choose Auto to experience it.    After creating a new Auto, you can see that the project template has created two projects for us: BlazorApp and BlazorApp.Client BlazorApp is the startup project, and BlazorApp.Client is a component library Then you can take a look at the Program in the startup project. An obvious change is that Blazor in .NET8 opens Blazor Server by adding a plug-in. Two ways to interact with WebAssembly. If not added, it is actually static mode. builder.Services.AddRazorComponents() .AddInteractiveServerComponents() .AddInteractiveWebAssemblyComponents(); … app.MapRazorComponents() .AddInteractiveServerRenderMode() .AddInteractiveWebAssemblyRenderMode() .AddAdditionalAssemblies(typeof(Counter).Assembly);…

First experience with .NET8 Blazor’s Auto rendering mode

First experience with .NET8 Blazor’s Auto rendering mode After the release of .NET8, Blazor supports four rendering methods Static rendering, this kind of page can only be displayed, does not provide interaction, and can be used for web content display Using Blazor Server hosting through Server interaction Browser-side interaction using WebAssembly hosting Use Auto to automatically interact, initially using Blazor Server, and using WebAssembly to automatically perform interactive client rendering on subsequent visits. Auto-rendering generally provides the fastest app launch experience. Experience When creating a Blazor application through VS, select the new template Blazor Web App. During the process, you can see that there are four templates to choose from. We can choose Auto to experience it.    After creating a new Auto, you can see that the project template has created two projects for us: BlazorApp and BlazorApp.Client BlazorApp is the startup project, and BlazorApp.Client is a component library Then you can take a look at the Program in the startup project. An obvious change is that Blazor in .NET8 opens Blazor Server by adding a plug-in. Two ways to interact with WebAssembly. If not added, it is actually static mode. builder.Services.AddRazorComponents() .AddInteractiveServerComponents() .AddInteractiveWebAssemblyComponents(); … app.MapRazorComponents() .AddInteractiveServerRenderMode() .AddInteractiveWebAssemblyRenderMode() .AddAdditionalAssemblies(typeof(Counter).Assembly);…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索