Lire en anglais

Partager via


HostingHostBuilderExtensions.UseContentRoot(IHostBuilder, String) Method

Definition

Specifies the content root directory to be used by the host. To avoid the content root directory being overwritten by a default value, ensure this is called after defaults are configured.

C#
public static Microsoft.Extensions.Hosting.IHostBuilder UseContentRoot(this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, string contentRoot);

Parameters

hostBuilder
IHostBuilder

The IHostBuilder to configure.

contentRoot
String

Path to root directory of the application.

Returns

The IHostBuilder.

Applies to

Produit Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)