Table of Contents

Environments Class

Definition

Namespace
Cuemon.Extensions.Hosting
Assemblies
Cuemon.Extensions.Hosting.dll
Source
src/Cuemon.Extensions.Hosting/Environments.cs

Provides a set of constants for commonly used environment names.

public static class Environments
Inheritance
Environments

Examples

The following example shows how to configure a .NET generic host to use the Environments.LocalDevelopment environment. The host is built and run with this environment setting.

// Program.cs
using System;
using Cuemon.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

using var host = Host.CreateDefaultBuilder()
    .UseEnvironment(Cuemon.Extensions.Hosting.Environments.LocalDevelopment)
    .Build();

Console.WriteLine(host.Services.GetRequiredService<IHostEnvironment>().EnvironmentName);

Fields

Name Description
LocalDevelopment

Defines a local development environment.