diff --git a/build/Packages.props b/build/Packages.props index a023ce4b56..42906eae85 100644 --- a/build/Packages.props +++ b/build/Packages.props @@ -2,7 +2,6 @@ - 2.2.0 6.0.0 17.3.0 17.3.1 @@ -20,11 +19,6 @@ - - - - - @@ -94,5 +88,11 @@ + + + + + + diff --git a/src/OmniSharp.Http/Host.cs b/src/OmniSharp.Http/Host.cs index ae35b31459..8832935e28 100644 --- a/src/OmniSharp.Http/Host.cs +++ b/src/OmniSharp.Http/Host.cs @@ -1,6 +1,9 @@ using System; using System.Diagnostics; using Microsoft.AspNetCore.Hosting; +#if NETCOREAPP +using Microsoft.Extensions.Hosting; +#endif using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using OmniSharp.Eventing; @@ -38,7 +41,13 @@ public void Start() .AddCommandLine(new[] { "--server.urls", $"http://{_serverInterface}:{_serverPort}" }); var builder = new WebHostBuilder() +#if NETCOREAPP + .UseKestrel(config => { + config.AllowSynchronousIO = true; + }) +#else .UseKestrel() +#endif .ConfigureServices(serviceCollection => { serviceCollection.AddSingleton(_environment); @@ -56,7 +65,11 @@ public void Start() { app.Start(); +#if NETCOREAPP + var appLifeTime = app.Services.GetRequiredService(); +#else var appLifeTime = app.Services.GetRequiredService(); +#endif Console.CancelKeyPress += (sender, e) => { diff --git a/src/OmniSharp.Http/Middleware/StopServerMiddleware.cs b/src/OmniSharp.Http/Middleware/StopServerMiddleware.cs index 18e65cae6d..4fb62fd054 100644 --- a/src/OmniSharp.Http/Middleware/StopServerMiddleware.cs +++ b/src/OmniSharp.Http/Middleware/StopServerMiddleware.cs @@ -1,15 +1,25 @@ using System.Threading; using System.Threading.Tasks; +#if NETCOREAPP +using Microsoft.Extensions.Hosting; +#else using Microsoft.AspNetCore.Hosting; +#endif using Microsoft.AspNetCore.Http; namespace OmniSharp.Http.Middleware { class StopServerMiddleware { +#if NETCOREAPP + private readonly IHostApplicationLifetime _lifetime; + + public StopServerMiddleware(RequestDelegate next, IHostApplicationLifetime lifetime) +#else private readonly IApplicationLifetime _lifetime; public StopServerMiddleware(RequestDelegate next, IApplicationLifetime lifetime) +#endif { _lifetime = lifetime; } diff --git a/src/OmniSharp.Http/OmniSharp.Http.csproj b/src/OmniSharp.Http/OmniSharp.Http.csproj index 0817374654..b1a7305632 100644 --- a/src/OmniSharp.Http/OmniSharp.Http.csproj +++ b/src/OmniSharp.Http/OmniSharp.Http.csproj @@ -5,6 +5,10 @@ AnyCPU + + + + @@ -14,8 +18,11 @@ + + +