Bit.Tooling.Templates.TodoTemplate
12.0.0-pre-06
See the version list below for details.
dotnet new install Bit.Tooling.Templates.TodoTemplate::12.0.0-pre-06
TodoTemplate
Blazor multi mode with best practices in mind!
In Directory.build.props, you can switch between blazor server / web assembly and hybrid by using either
<BlazorMode>BlazorWebAssembly</BlazorMode>
<BlazorMode>BlazorServer</BlazorMode>
<BlazorMode>BlazorHybrid</BlazorMode>
For blazor web assembly use followings in TodoTemplate.App:
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
for blazor server use:
<Project Sdk="Microsoft.NET.Sdk.Web">
For blazor hybrid, use Bit.Client.Web.BlazorUI.App project instead.
To run blazor web assembly only start Api project and use 'TodoTemplate.Api-BlazorWebAssembly' debug profile, but for blazor hybrid you need multi startup for both api & app projects. In blazor server you need multi startup for both api & web projects. In Blazor hybrid and server, use 'TodoTemplate.Api' debug profile for api project. For enhanced development experience, unload App project while debugging in server/web assembly modes and unload web project while debugging hybrid mode.
In shared project, you can also detect code is running in blazor server / web assembly or hybrid mode by use any of followings:
if (TodoTemplate.Shared.BlazorModeDetector.Current.IsBlazorServer())
{
}
#if BlazorWebAssembly
#endif
It's recommended to clear your browser's cache and close/open visual studio while switching between blazor modes!
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
12.0.0-pre-08 | 253 | 6/27/2022 | |
12.0.0-pre-07 | 142 | 6/27/2022 | |
12.0.0-pre-06 | 198 | 6/25/2022 |