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
如果首选在 上配置的 URL, IWebHostBuilder则为 ;否则为 false
。