Runtime server features for ASP.NET Core Blazor applications. This package was built from the source code at https://github.com/dotnet/dotnet/tree/87bc0b04e21d786669142109a5128c95618b75ed
$ dotnet add package Microsoft.AspNetCore.Components.WebAssembly.ServerMicrosoft.AspNetCore.Components.WebAssembly.Server provides runtime server features for ASP.NET Core Blazor applications that have a client running under WebAssembly.
To use Microsoft.AspNetCore.Components.WebAssembly.Server, follow these steps:
dotnet add package Microsoft.AspNetCore.Components.WebAssembly.Server
To enable WebAssembly interactivity in a Blazor Web app, configure it in your app's Program.cs:
builder.Services.AddRazorComponents()
.AddInteractiveWebAssemblyComponents();
var app = builder.Build();
if (app.Environment.IsDevelopment())
{
app.UseWebAssemblyDebugging();
}
app.UseAntiforgery();
app.MapStaticAssets();
app.MapRazorComponents<App>()
.AddInteractiveWebAssemblyRenderMode()
.AddAdditionalAssemblies(typeof(BlazorWebApp.Client._Imports).Assembly);
Make sure to update the call to AddAdditionalAssemblies with any client assemblies that should be included in the Blazor application.
The main types provided by this package are:
WebAssemblyComponentsEndpointOptions: Provides options for configuring interactive WebAssembly componentsAuthenticationStateSerializationOptions: Provides options for configuring the JSON serialization of the AuthenticationState to the WebAssembly clientFor additional documentation and examples, refer to the official documentation on Blazor.
Microsoft.AspNetCore.Components.WebAssembly.Server is released as open-source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.