File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,11 @@ public virtual IServiceProvider Services
110110 }
111111 }
112112
113+ /// <summary>
114+ /// Helps determine if the `StartServer` method has been called already.
115+ /// </summary>
116+ private bool ServerStarted => _webHost != null || _host != null || _server != null ;
117+
113118 /// <summary>
114119 /// Gets the <see cref="IReadOnlyList{WebApplicationFactory}"/> of factories created from this factory
115120 /// by further customizing the <see cref="IWebHostBuilder"/> when calling
@@ -239,7 +244,7 @@ private void ConfigureBuilderToUseKestrel(IWebHostBuilder builder)
239244 /// <exception cref="InvalidOperationException">Thrown if the provided <typeparamref name="TEntryPoint"/> type has no factory method.</exception>
240245 public void StartServer ( )
241246 {
242- if ( _webHost != null || _host != null )
247+ if ( ServerStarted )
243248 {
244249 return ;
245250 }
You can’t perform that action at this time.
0 commit comments