HostingAbstractionsWebHostBuilderExtensions.PreferHostingUrls 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
指出主機是否應該接聽 上 IWebHostBuilder 設定的 URL,而不是在 上設定的 IServer URL。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ PreferHostingUrls(Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ hostBuilder, bool preferHostingUrls);
public static Microsoft.AspNetCore.Hosting.IWebHostBuilder PreferHostingUrls (this Microsoft.AspNetCore.Hosting.IWebHostBuilder hostBuilder, bool preferHostingUrls);
static member PreferHostingUrls : Microsoft.AspNetCore.Hosting.IWebHostBuilder * bool -> Microsoft.AspNetCore.Hosting.IWebHostBuilder
<Extension()>
Public Function PreferHostingUrls (hostBuilder As IWebHostBuilder, preferHostingUrls As Boolean) As IWebHostBuilder
參數
- hostBuilder
- IWebHostBuilder
要設定的 IWebHostBuilder。
- preferHostingUrls
- Boolean
true
表示偏好在 IWebHostBuilder 上設定的 URL,否則 false
為 。