WebHostBuilderExtensions.UseTestServer Method
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.
UseTestServer(IWebHostBuilder) |
Enables the TestServer service. |
UseTestServer(IWebHostBuilder, Action<TestServerOptions>) |
Enables the TestServer service. |
- Source:
- WebHostBuilderExtensions.cs
- Source:
- WebHostBuilderExtensions.cs
- Source:
- WebHostBuilderExtensions.cs
- Source:
- WebHostBuilderExtensions.cs
- Source:
- WebHostBuilderExtensions.cs
- Source:
- WebHostBuilderExtensions.cs
- Source:
- WebHostBuilderExtensions.cs
Enables the TestServer service.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ UseTestServer(Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ builder);
C#
public static Microsoft.AspNetCore.Hosting.IWebHostBuilder UseTestServer (this Microsoft.AspNetCore.Hosting.IWebHostBuilder builder);
static member UseTestServer : Microsoft.AspNetCore.Hosting.IWebHostBuilder -> Microsoft.AspNetCore.Hosting.IWebHostBuilder
<Extension()>
Public Function UseTestServer (builder As IWebHostBuilder) As IWebHostBuilder
Parameters
- builder
- IWebHostBuilder
The IWebHostBuilder.
Returns
The IWebHostBuilder.
Applies to
ASP.NET Core 9.0 and other versions
Product | Versions |
---|---|
ASP.NET Core | 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0 |
- Source:
- WebHostBuilderExtensions.cs
- Source:
- WebHostBuilderExtensions.cs
- Source:
- WebHostBuilderExtensions.cs
- Source:
- WebHostBuilderExtensions.cs
Enables the TestServer service.
C#
public static Microsoft.AspNetCore.Hosting.IWebHostBuilder UseTestServer (this Microsoft.AspNetCore.Hosting.IWebHostBuilder builder, Action<Microsoft.AspNetCore.TestHost.TestServerOptions> configureOptions);
static member UseTestServer : Microsoft.AspNetCore.Hosting.IWebHostBuilder * Action<Microsoft.AspNetCore.TestHost.TestServerOptions> -> Microsoft.AspNetCore.Hosting.IWebHostBuilder
<Extension()>
Public Function UseTestServer (builder As IWebHostBuilder, configureOptions As Action(Of TestServerOptions)) As IWebHostBuilder
Parameters
- builder
- IWebHostBuilder
The IWebHostBuilder.
- configureOptions
- Action<TestServerOptions>
Configures test server options
Returns
The IWebHostBuilder.
Applies to
ASP.NET Core 9.0 and other versions
Product | Versions |
---|---|
ASP.NET Core | 6.0, 7.0, 8.0, 9.0 |