WebHostBuilderExtensions.GetTestServer(IWebHost) Method
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.
Caution
IWebHost is obsolete. Use IHost instead. For more information, visit https://aka.ms/aspnet/deprecate/008.
Retrieves the TestServer from the host services.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::TestHost::TestServer ^ GetTestServer(Microsoft::AspNetCore::Hosting::IWebHost ^ host);
[System.Obsolete("IWebHost is obsolete. Use IHost instead. For more information, visit https://aka.ms/aspnet/deprecate/008.", DiagnosticId="ASPDEPR008", UrlFormat="https://aka.ms/aspnet/deprecate/008")]
public static Microsoft.AspNetCore.TestHost.TestServer GetTestServer(this Microsoft.AspNetCore.Hosting.IWebHost host);
public static Microsoft.AspNetCore.TestHost.TestServer GetTestServer(this Microsoft.AspNetCore.Hosting.IWebHost host);
[<System.Obsolete("IWebHost is obsolete. Use IHost instead. For more information, visit https://aka.ms/aspnet/deprecate/008.", DiagnosticId="ASPDEPR008", UrlFormat="https://aka.ms/aspnet/deprecate/008")>]
static member GetTestServer : Microsoft.AspNetCore.Hosting.IWebHost -> Microsoft.AspNetCore.TestHost.TestServer
static member GetTestServer : Microsoft.AspNetCore.Hosting.IWebHost -> Microsoft.AspNetCore.TestHost.TestServer
<Extension()>
Public Function GetTestServer (host As IWebHost) As TestServer
Parameters
- host
- IWebHost
Returns
- Attributes