共用方式為


HostingAbstractionsWebHostBuilderExtensions.UseContentRoot 方法

定義

指定 Web 主機要使用的內容根目錄。

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

參數

hostBuilder
IWebHostBuilder

要設定的 IWebHostBuilder

contentRoot
String

應用程式根目錄的路徑。

傳回

IWebHostBuilder

適用於