Share via


HostingAbstractionsWebHostBuilderExtensions.PreferHostingUrls Method

Definition

Indicate whether the host should listen on the URLs configured on the IWebHostBuilder instead of those configured on the IServer.

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

Parameters

hostBuilder
IWebHostBuilder

The IWebHostBuilder to configure.

preferHostingUrls
Boolean

true to prefer URLs configured on the IWebHostBuilder; otherwise false.

Returns

The IWebHostBuilder.

Applies to