IWebHostBuilder Interface¶
A builder for Microsoft.AspNetCore.Hosting.IWebHost.
- Namespace
Microsoft.AspNetCore.Hosting- Assemblies
- Microsoft.AspNetCore.Hosting.Abstractions
Methods¶
-
Build()¶ Builds an
Microsoft.AspNetCore.Hosting.IWebHostwhich hosts a web application.Return type: Microsoft.AspNetCore.Hosting.IWebHost IWebHost Build()
-
ConfigureLogging(System.Action<Microsoft.Extensions.Logging.ILoggerFactory>)¶ Adds a delegate for configuring the provided
Microsoft.Extensions.Logging.ILoggerFactory. This may be called multiple times.Arguments: configureLogging (System.Action<Microsoft.Extensions.Logging.ILoggerFactory>) – The delegate that configures the Microsoft.Extensions.Logging.ILoggerFactory.Return type: Microsoft.AspNetCore.Hosting.IWebHostBuilder Returns: The Microsoft.AspNetCore.Hosting.IWebHostBuilder.IWebHostBuilder ConfigureLogging(Action<ILoggerFactory> configureLogging)
-
ConfigureServices(System.Action<Microsoft.Extensions.DependencyInjection.IServiceCollection>)¶ Specify the delegate that is used to configure the services of the web application.
Arguments: configureServices (System.Action<Microsoft.Extensions.DependencyInjection.IServiceCollection>) – The delegate that configures the Microsoft.Extensions.DependencyInjection.IServiceCollection.Return type: Microsoft.AspNetCore.Hosting.IWebHostBuilder Returns: The Microsoft.AspNetCore.Hosting.IWebHostBuilder.IWebHostBuilder ConfigureServices(Action<IServiceCollection> configureServices)
-
GetSetting(System.String)¶ Get the setting value from the configuration.
Arguments: key (System.String) – The key of the setting to look up. Return type: System.String Returns: The value the setting currently contains. string GetSetting(string key)
-
UseLoggerFactory(Microsoft.Extensions.Logging.ILoggerFactory)¶ Specify the
Microsoft.Extensions.Logging.ILoggerFactoryto be used by the web host.Arguments: loggerFactory (Microsoft.Extensions.Logging.ILoggerFactory) – The Microsoft.Extensions.Logging.ILoggerFactoryto be used.Return type: Microsoft.AspNetCore.Hosting.IWebHostBuilder Returns: The Microsoft.AspNetCore.Hosting.IWebHostBuilder.IWebHostBuilder UseLoggerFactory(ILoggerFactory loggerFactory)
-
UseSetting(System.String, System.String)¶ Add or replace a setting in the configuration.
Arguments: - key (System.String) – The key of the setting to add or replace.
- value (System.String) – The value of the setting to add or replace.
Return type: Returns: IWebHostBuilder UseSetting(string key, string value)
-