Skip to content

ApplicationBuilderExtensions class

Namespace: Vitreous.DevUI.Extensions
Assembly: Vitreous.DevUI.dll

Extension methods to register and enable the Vitreous Developer UI.

public static class ApplicationBuilderExtensions

object ← ApplicationBuilderExtensions

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

AddVitreousDevUI(IServiceCollection, Action<VitreousDevUIOptions>?)

Section titled “ AddVitreousDevUI(IServiceCollection, Action<VitreousDevUIOptions>?)”

Registers Vitreous DevUI services in the DI container. Call this in builder.Services before builder.Build().

[RequiresUnreferencedCode("Vitreous.DevUI is a development tool that serializes arbitrary messages with reflection. Leave it out of trimmed and Native AOT builds.")]
[RequiresDynamicCode("Vitreous.DevUI is a development tool that serializes arbitrary messages with reflection. Leave it out of trimmed and Native AOT builds.")]
public static IServiceCollection AddVitreousDevUI(this IServiceCollection services, Action<VitreousDevUIOptions>? configure = null)

services IServiceCollection

configure Action<VitreousDevUIOptions>?

IServiceCollection

Registering the services is safe in every environment: nothing is traced until UseVitreousDevUI or MapVitreousDevUI activates the UI, which by default only happens in Development (see Enabled).

MapVitreousDevUI(IEndpointRouteBuilder, string?)

Section titled “ MapVitreousDevUI(IEndpointRouteBuilder, string?)”

Maps the Vitreous Developer UI endpoints under pathPrefix (default: PathPrefix) and activates tracing — when Enabled allows it (by default, only in the Development environment). Otherwise no endpoints are mapped.

[RequiresUnreferencedCode("Vitreous.DevUI is a development tool that serializes arbitrary messages with reflection. Leave it out of trimmed and Native AOT builds.")]
[RequiresDynamicCode("Vitreous.DevUI is a development tool that serializes arbitrary messages with reflection. Leave it out of trimmed and Native AOT builds.")]
public static RouteGroupBuilder MapVitreousDevUI(this IEndpointRouteBuilder endpoints, string? pathPrefix = null)

endpoints IEndpointRouteBuilder

pathPrefix string?

RouteGroupBuilder

The route group, so endpoint conventions apply to every DevUI endpoint, e.g. app.MapVitreousDevUI().RequireAuthorization().

Enables the Vitreous Developer UI as middleware at the configured path prefix and activates tracing — when Enabled allows it (by default, only in the Development environment). Otherwise this does nothing.

[RequiresUnreferencedCode("Vitreous.DevUI is a development tool that serializes arbitrary messages with reflection. Leave it out of trimmed and Native AOT builds.")]
[RequiresDynamicCode("Vitreous.DevUI is a development tool that serializes arbitrary messages with reflection. Leave it out of trimmed and Native AOT builds.")]
public static IApplicationBuilder UseVitreousDevUI(this IApplicationBuilder app)

app IApplicationBuilder

IApplicationBuilder

To protect the UI with authorization, use MapVitreousDevUI instead:

app.MapVitreousDevUI().RequireAuthorization("Admins");