Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

WebApplicationFactory<TEntryPoint>.CreateHostBuilder Method

Definition

Namespace:
Microsoft.AspNetCore.Mvc.Testing
Assembly:
Microsoft.AspNetCore.Mvc.Testing.dll
Package:
Microsoft.AspNetCore.Mvc.Testing v10.0.0
Package:
Microsoft.AspNetCore.Mvc.Testing v11.0.0-preview.4.26230.115
Package:
Microsoft.AspNetCore.Mvc.Testing v3.0.3
Package:
Microsoft.AspNetCore.Mvc.Testing v3.1.18
Package:
Microsoft.AspNetCore.Mvc.Testing v5.0.9
Package:
Microsoft.AspNetCore.Mvc.Testing v6.0.6
Package:
Microsoft.AspNetCore.Mvc.Testing v7.0.5
Package:
Microsoft.AspNetCore.Mvc.Testing v8.0.19
Package:
Microsoft.AspNetCore.Mvc.Testing v9.0.8
Source:
WebApplicationFactory.cs
Source:
WebApplicationFactory.cs
Source:
WebApplicationFactory.cs
Source:
WebApplicationFactory.cs
Source:
WebApplicationFactory.cs
Source:
WebApplicationFactory.cs
Source:
WebApplicationFactory.cs
Source:
WebApplicationFactory.cs
Source:
WebApplicationFactory.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Creates a IHostBuilder used to set up TestServer.

protected:
 virtual Microsoft::Extensions::Hosting::IHostBuilder ^ CreateHostBuilder();
protected virtual Microsoft.Extensions.Hosting.IHostBuilder? CreateHostBuilder();
protected virtual Microsoft.Extensions.Hosting.IHostBuilder CreateHostBuilder();
abstract member CreateHostBuilder : unit -> Microsoft.Extensions.Hosting.IHostBuilder
override this.CreateHostBuilder : unit -> Microsoft.Extensions.Hosting.IHostBuilder
Protected Overridable Function CreateHostBuilder () As IHostBuilder

Returns

A IHostBuilder instance.

Remarks

The default implementation of this method looks for a public static IHostBuilder CreateHostBuilder(string[] args) method defined on the entry point of the assembly of TEntryPoint and invokes it passing an empty string array as arguments.

Applies to


Feedback

Was this page helpful?