WebAssemblyHostEnvironmentExtensions.IsProduction Method

Definition

Checks if the current hosting environment name is Production.

C#
public static bool IsProduction (this Microsoft.AspNetCore.Components.WebAssembly.Hosting.IWebAssemblyHostEnvironment hostingEnvironment);

Parameters

hostingEnvironment
IWebAssemblyHostEnvironment

An instance of IWebAssemblyHostEnvironment.

Returns

True if the environment name is Production, otherwise false.

Applies to

Product Versions
ASP.NET Core 3.1, 5.0, 6.0, 7.0, 8.0, 9.0