RazorDocs Search
API Reference

Standalone

Type

RazorDocsStandaloneHost

Source

Creates and runs the standalone RazorDocs host used by the executable wrapper and integration tests.

Remarks

Use this type when code needs the same host shape as Program.cs without shelling out to dotnet run. The builder keeps the RazorDocs root module, routes, static web assets, and configuration binding on the normal AppSurface Web startup path. CreateBuilder is a low-level host-builder seam; callers that start the host themselves should pass an explicit endpoint or configure the web host before building.

Method

RunAsync

2 overloads
Task RunAsync(string[] args) Source

Runs the standalone RazorDocs web application until the host shuts down.

Parameters

  • argsCommand-line arguments forwarded to the AppSurface Web startup pipeline.

Returns

A task that completes when the host exits.

Task RunAsync(string[] args, Action<WebOptions>? configureOptions) Source

Runs the standalone RazorDocs web application with optional host web-option customization.

Parameters

  • argsCommand-line arguments forwarded to the AppSurface Web startup pipeline.
  • configureOptionsOptional web-options callback applied after module defaults, before the host is built. Package-hosted command-line tools use this seam to disable static-web-asset manifest loading when their required assets are embedded in assemblies instead.

Returns

A task that completes when the host exits.

Method

CreateBuilder

2 overloads
IHostBuilder CreateBuilder(string[] args, IEnvironmentProvider? environmentProvider = null) Source

Creates a configured host builder for the standalone RazorDocs application without starting it.

Parameters

  • argsCommand-line arguments forwarded to the Generic Host and RazorDocs configuration binder.
  • environmentProviderOptional environment provider used by AppSurface startup decisions before the Generic Host has been built. Leave unset for normal executable startup; tests can pass a fixed provider to avoid process-wide environment variable mutation.

Returns

An IHostBuilder for the standalone RazorDocs application.

Remarks

The builder pins the standalone assembly as the entry point identity so in-process test hosts still resolve the same static web asset manifest that the executable resolves. Without that override, test runners would use their own process entry assembly and miss RazorDocs assets. This overload is kept for source and binary compatibility; use the three-parameter overload when a packaged tool needs to customize AppSurface Web options.

IHostBuilder CreateBuilder(string[] args, IEnvironmentProvider? environmentProvider, Action<WebOptions>? configureOptions = null) Source

Creates a configured host builder for the standalone RazorDocs application without starting it.

Parameters

  • argsCommand-line arguments forwarded to the Generic Host and RazorDocs configuration binder.
  • environmentProviderOptional environment provider used by AppSurface startup decisions before the Generic Host has been built. Leave unset for normal executable startup; tests can pass a fixed provider to avoid process-wide environment variable mutation.
  • configureOptionsOptional web-options callback applied after module defaults, before the host is built.

Returns

An IHostBuilder for the standalone RazorDocs application.

Remarks

This overload preserves the original two-parameter CreateBuilder method for already-compiled callers while giving packaged tools a host-shape seam for static-web-asset and startup-watchdog options.