TestServer Constructors
Definition
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.
Overloads
| Name | Description |
|---|---|
| TestServer(IWebHostBuilder) |
Obsolete.
For use with IWebHostBuilder. |
| TestServer(IServiceProvider) |
For use with IHostBuilder. |
| TestServer(IWebHostBuilder, IFeatureCollection) |
Obsolete.
For use with IWebHostBuilder. |
| TestServer(IServiceProvider, IFeatureCollection) |
For use with IHostBuilder. |
| TestServer(IServiceProvider, IOptions<TestServerOptions>) |
For use with IHostBuilder. |
| TestServer(IServiceProvider, IFeatureCollection, IOptions<TestServerOptions>) |
For use with IHostBuilder. |
TestServer(IWebHostBuilder)
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
Caution
IWebHost, which this method uses, is obsolete. Use one of the ctors that takes an IServiceProvider instead. For more information, visit https://aka.ms/aspnet/deprecate/008.
For use with IWebHostBuilder.
public:
TestServer(Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ builder);
public TestServer(Microsoft.AspNetCore.Hosting.IWebHostBuilder builder);
[System.Obsolete("IWebHost, which this method uses, is obsolete. Use one of the ctors that takes an IServiceProvider instead. For more information, visit https://aka.ms/aspnet/deprecate/008.", DiagnosticId="ASPDEPR008", UrlFormat="https://aka.ms/aspnet/deprecate/008")]
public TestServer(Microsoft.AspNetCore.Hosting.IWebHostBuilder builder);
new Microsoft.AspNetCore.TestHost.TestServer : Microsoft.AspNetCore.Hosting.IWebHostBuilder -> Microsoft.AspNetCore.TestHost.TestServer
[<System.Obsolete("IWebHost, which this method uses, is obsolete. Use one of the ctors that takes an IServiceProvider instead. For more information, visit https://aka.ms/aspnet/deprecate/008.", DiagnosticId="ASPDEPR008", UrlFormat="https://aka.ms/aspnet/deprecate/008")>]
new Microsoft.AspNetCore.TestHost.TestServer : Microsoft.AspNetCore.Hosting.IWebHostBuilder -> Microsoft.AspNetCore.TestHost.TestServer
Public Sub New (builder As IWebHostBuilder)
Parameters
- builder
- IWebHostBuilder
- Attributes
Applies to
TestServer(IServiceProvider)
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
For use with IHostBuilder.
public:
TestServer(IServiceProvider ^ services);
public TestServer(IServiceProvider services);
new Microsoft.AspNetCore.TestHost.TestServer : IServiceProvider -> Microsoft.AspNetCore.TestHost.TestServer
Public Sub New (services As IServiceProvider)
Parameters
- services
- IServiceProvider
Applies to
TestServer(IWebHostBuilder, IFeatureCollection)
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
Caution
IWebHost, which this method uses, is obsolete. Use one of the ctors that takes an IServiceProvider instead. For more information, visit https://aka.ms/aspnet/deprecate/008.
For use with IWebHostBuilder.
public:
TestServer(Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ builder, Microsoft::AspNetCore::Http::Features::IFeatureCollection ^ featureCollection);
[System.Obsolete("IWebHost, which this method uses, is obsolete. Use one of the ctors that takes an IServiceProvider instead. For more information, visit https://aka.ms/aspnet/deprecate/008.", DiagnosticId="ASPDEPR008", UrlFormat="https://aka.ms/aspnet/deprecate/008")]
public TestServer(Microsoft.AspNetCore.Hosting.IWebHostBuilder builder, Microsoft.AspNetCore.Http.Features.IFeatureCollection featureCollection);
public TestServer(Microsoft.AspNetCore.Hosting.IWebHostBuilder builder, Microsoft.AspNetCore.Http.Features.IFeatureCollection featureCollection);
[<System.Obsolete("IWebHost, which this method uses, is obsolete. Use one of the ctors that takes an IServiceProvider instead. For more information, visit https://aka.ms/aspnet/deprecate/008.", DiagnosticId="ASPDEPR008", UrlFormat="https://aka.ms/aspnet/deprecate/008")>]
new Microsoft.AspNetCore.TestHost.TestServer : Microsoft.AspNetCore.Hosting.IWebHostBuilder * Microsoft.AspNetCore.Http.Features.IFeatureCollection -> Microsoft.AspNetCore.TestHost.TestServer
new Microsoft.AspNetCore.TestHost.TestServer : Microsoft.AspNetCore.Hosting.IWebHostBuilder * Microsoft.AspNetCore.Http.Features.IFeatureCollection -> Microsoft.AspNetCore.TestHost.TestServer
Public Sub New (builder As IWebHostBuilder, featureCollection As IFeatureCollection)
Parameters
- builder
- IWebHostBuilder
- featureCollection
- IFeatureCollection
- Attributes
Applies to
TestServer(IServiceProvider, IFeatureCollection)
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
For use with IHostBuilder.
public:
TestServer(IServiceProvider ^ services, Microsoft::AspNetCore::Http::Features::IFeatureCollection ^ featureCollection);
public TestServer(IServiceProvider services, Microsoft.AspNetCore.Http.Features.IFeatureCollection featureCollection);
new Microsoft.AspNetCore.TestHost.TestServer : IServiceProvider * Microsoft.AspNetCore.Http.Features.IFeatureCollection -> Microsoft.AspNetCore.TestHost.TestServer
Public Sub New (services As IServiceProvider, featureCollection As IFeatureCollection)
Parameters
- services
- IServiceProvider
- featureCollection
- IFeatureCollection
Applies to
TestServer(IServiceProvider, IOptions<TestServerOptions>)
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
For use with IHostBuilder.
public TestServer(IServiceProvider services, Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.TestHost.TestServerOptions> optionsAccessor);
new Microsoft.AspNetCore.TestHost.TestServer : IServiceProvider * Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.TestHost.TestServerOptions> -> Microsoft.AspNetCore.TestHost.TestServer
Public Sub New (services As IServiceProvider, optionsAccessor As IOptions(Of TestServerOptions))
Parameters
- services
- IServiceProvider
- optionsAccessor
- IOptions<TestServerOptions>
Applies to
TestServer(IServiceProvider, IFeatureCollection, IOptions<TestServerOptions>)
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
- Source:
- TestServer.cs
For use with IHostBuilder.
public TestServer(IServiceProvider services, Microsoft.AspNetCore.Http.Features.IFeatureCollection featureCollection, Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.TestHost.TestServerOptions> optionsAccessor);
new Microsoft.AspNetCore.TestHost.TestServer : IServiceProvider * Microsoft.AspNetCore.Http.Features.IFeatureCollection * Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.TestHost.TestServerOptions> -> Microsoft.AspNetCore.TestHost.TestServer
Public Sub New (services As IServiceProvider, featureCollection As IFeatureCollection, optionsAccessor As IOptions(Of TestServerOptions))
Parameters
- services
- IServiceProvider
- featureCollection
- IFeatureCollection
- optionsAccessor
- IOptions<TestServerOptions>