From 226257020be4fd04536fc699ab349b118efc12aa Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Thu, 19 Mar 2015 12:11:02 -0700 Subject: [PATCH] React to hosting --- .../KestrelWebSocketHelpers.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/test/Microsoft.AspNet.WebSockets.Client.Test/KestrelWebSocketHelpers.cs b/test/Microsoft.AspNet.WebSockets.Client.Test/KestrelWebSocketHelpers.cs index f0cc35fd72..86686dab39 100644 --- a/test/Microsoft.AspNet.WebSockets.Client.Test/KestrelWebSocketHelpers.cs +++ b/test/Microsoft.AspNet.WebSockets.Client.Test/KestrelWebSocketHelpers.cs @@ -5,10 +5,9 @@ using System; using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Hosting; +using Microsoft.AspNet.Hosting.Startup; using Microsoft.AspNet.Http; using Microsoft.Framework.ConfigurationModel; -using Microsoft.Framework.DependencyInjection; -using Microsoft.Framework.Runtime.Infrastructure; namespace Microsoft.AspNet.WebSockets.Client.Test { @@ -45,20 +44,14 @@ namespace Microsoft.AspNet.WebSockets.Client.Test var config = new Configuration(); config.Add(new MemoryConfigurationSource()); config.Set("server.urls", "http://localhost:54321"); - var services = HostingServices.Create(CallContextServiceLocator.Locator?.ServiceProvider, config) - .BuildServiceProvider(); - var applicationLifetime = services.GetRequiredService(); var context = new HostingContext() { - ApplicationLifetime = applicationLifetime, Configuration = config, ServerFactoryLocation = "Kestrel", - ApplicationStartup = startup, + StartupMethods = new StartupMethods(startup, configureServices: null) }; - - var engine = services.GetRequiredService(); - return engine.Start(context); + return new HostingEngine().Start(context); } } } \ No newline at end of file