Don't dispose the server anymore, the container does it

This commit is contained in:
David Fowler 2016-04-18 22:47:28 -07:00
parent 8f5f8d28d0
commit 933a2f5a1d
2 changed files with 2 additions and 3 deletions

View File

@ -212,7 +212,6 @@ namespace Microsoft.AspNetCore.Hosting.Internal
{
_logger?.Shutdown();
_applicationLifetime.StopApplication();
Server?.Dispose();
(_applicationServices as IDisposable)?.Dispose();
_applicationLifetime.NotifyStopped();
}

View File

@ -129,7 +129,7 @@ namespace Microsoft.AspNetCore.Hosting
host.Dispose();
Assert.Equal(2, _startInstances[0].DisposeCalls); // Once as the server, once from the DI Container
Assert.Equal(1, _startInstances[0].DisposeCalls);
}
[Fact]
@ -157,7 +157,7 @@ namespace Microsoft.AspNetCore.Hosting
// Wait on the host to shutdown
lifetime.ApplicationStopped.WaitHandle.WaitOne();
Assert.Equal(2, _startInstances[0].DisposeCalls); // Once as the server, once from the DI Container
Assert.Equal(1, _startInstances[0].DisposeCalls);
}
[Fact]