HostingHostBuilderExtensions.UseContentRoot(IHostBuilder, String) 方法

定義

指定主機要使用的內容根目錄。Specify the content root directory to be used by the host.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Hosting::IHostBuilder ^ UseContentRoot(Microsoft::Extensions::Hosting::IHostBuilder ^ hostBuilder, System::String ^ contentRoot);
public static Microsoft.Extensions.Hosting.IHostBuilder UseContentRoot (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, string contentRoot);
static member UseContentRoot : Microsoft.Extensions.Hosting.IHostBuilder * string -> Microsoft.Extensions.Hosting.IHostBuilder
<Extension()>
Public Function UseContentRoot (hostBuilder As IHostBuilder, contentRoot As String) As IHostBuilder

參數

hostBuilder
IHostBuilder

要設定的 IHostBuilderThe IHostBuilder to configure.

contentRoot
String

應用程式根目錄的路徑。Path to root directory of the application.

傳回

IHostBuilder

IHostBuilderThe IHostBuilder.

適用於