Share via


WebApplicationFactory<TEntryPoint>.CreateServer Method

Definition

Overloads

CreateServer(IWebHostBuilder)

Creates the TestServer with the bootstrapped application in builder. This is only called for applications using IWebHostBuilder. Applications based on IHostBuilder will use CreateHost(IHostBuilder) instead.

CreateServer(IServiceProvider)

Creates the TestServer with the IServiceProvider from the bootstrapped application. This is only called for applications using IHostBuilder. Applications based on IWebHostBuilder will use CreateHost(IHostBuilder) instead.

CreateServer(IWebHostBuilder)

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
Source:
WebApplicationFactory.cs

Creates the TestServer with the bootstrapped application in builder. This is only called for applications using IWebHostBuilder. Applications based on IHostBuilder will use CreateHost(IHostBuilder) instead.

protected:
 virtual Microsoft::AspNetCore::TestHost::TestServer ^ CreateServer(Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ builder);
protected virtual Microsoft.AspNetCore.TestHost.TestServer CreateServer(Microsoft.AspNetCore.Hosting.IWebHostBuilder builder);
abstract member CreateServer : Microsoft.AspNetCore.Hosting.IWebHostBuilder -> Microsoft.AspNetCore.TestHost.TestServer
override this.CreateServer : Microsoft.AspNetCore.Hosting.IWebHostBuilder -> Microsoft.AspNetCore.TestHost.TestServer
Protected Overridable Function CreateServer (builder As IWebHostBuilder) As TestServer

Parameters

builder
IWebHostBuilder

The IWebHostBuilder used to create the server.

Returns

The TestServer with the bootstrapped application.

Applies to

CreateServer(IServiceProvider)

Source:
WebApplicationFactory.cs

Creates the TestServer with the IServiceProvider from the bootstrapped application. This is only called for applications using IHostBuilder. Applications based on IWebHostBuilder will use CreateHost(IHostBuilder) instead.

protected virtual Microsoft.AspNetCore.TestHost.TestServer CreateServer(IServiceProvider serviceProvider);
abstract member CreateServer : IServiceProvider -> Microsoft.AspNetCore.TestHost.TestServer
override this.CreateServer : IServiceProvider -> Microsoft.AspNetCore.TestHost.TestServer
Protected Overridable Function CreateServer (serviceProvider As IServiceProvider) As TestServer

Parameters

serviceProvider
IServiceProvider

The IServiceProvider from the bootstrapped application.

Returns

Applies to