@@ -55,9 +55,9 @@ public void ConfigureServices(IServiceCollection serviceCollection)
5555 serviceCollection . AddHttpContextAccessor ( ) ;
5656 }
5757#if FORWARDCOMPAT
58- private async Task ContentRootPath ( HttpContext ctx ) => await ctx . Response . WriteAsync ( ctx . RequestServices . GetService < Microsoft . AspNetCore . Hosting . IHostingEnvironment > ( ) . ContentRootPath ) ;
58+ private async Task ContentRootPath ( HttpContext ctx ) => await ctx . Response . WriteAsync ( ctx . RequestServices . GetService < IWebHostEnvironment > ( ) . ContentRootPath ) ;
5959
60- private async Task WebRootPath ( HttpContext ctx ) => await ctx . Response . WriteAsync ( ctx . RequestServices . GetService < Microsoft . AspNetCore . Hosting . IHostingEnvironment > ( ) . WebRootPath ) ;
60+ private async Task WebRootPath ( HttpContext ctx ) => await ctx . Response . WriteAsync ( ctx . RequestServices . GetService < IWebHostEnvironment > ( ) . WebRootPath ) ;
6161#else
6262 private async Task ContentRootPath ( HttpContext ctx ) => await ctx . Response . WriteAsync ( ctx . RequestServices . GetService < IWebHostEnvironment > ( ) . ContentRootPath ) ;
6363
@@ -175,7 +175,7 @@ public async Task WaitingRequestCount(HttpContext context)
175175 public Task CreateFile ( HttpContext context )
176176 {
177177#if FORWARDCOMPAT
178- var hostingEnv = context . RequestServices . GetService < Microsoft . AspNetCore . Hosting . IHostingEnvironment > ( ) ;
178+ var hostingEnv = context . RequestServices . GetService < IWebHostEnvironment > ( ) ;
179179#else
180180 var hostingEnv = context . RequestServices . GetService < IWebHostEnvironment > ( ) ;
181181#endif
@@ -597,7 +597,7 @@ private async Task WaitForAppToStartShuttingDown(HttpContext ctx)
597597 {
598598 await ctx . Response . WriteAsync ( "test1" ) ;
599599#if FORWARDCOMPAT
600- var lifetime = ctx . RequestServices . GetService < Microsoft . AspNetCore . Hosting . IApplicationLifetime > ( ) ;
600+ var lifetime = ctx . RequestServices . GetService < IHostApplicationLifetime > ( ) ;
601601#else
602602 var lifetime = ctx . RequestServices . GetService < IHostApplicationLifetime > ( ) ;
603603#endif
@@ -680,8 +680,9 @@ private async Task ReadAndWriteEchoLines(HttpContext ctx)
680680 private async Task ReadAndWriteEchoLinesNoBuffering ( HttpContext ctx )
681681 {
682682#if FORWARDCOMPAT
683- var feature = ctx . Features . Get < IHttpBufferingFeature > ( ) ;
684- feature . DisableResponseBuffering ( ) ;
683+ var feature = ctx . Features . Get < IHttpResponseBodyFeature > ( ) ;
684+ feature . DisableBuffering ( ) ;
685+ Assert . True ( ctx . Request . CanHaveBody ( ) ) ;
685686#else
686687 var feature = ctx . Features . Get < IHttpResponseBodyFeature > ( ) ;
687688 feature . DisableBuffering ( ) ;
@@ -993,7 +994,7 @@ private async Task Shutdown(HttpContext ctx)
993994 {
994995 await ctx . Response . WriteAsync ( "Shutting down" ) ;
995996#if FORWARDCOMPAT
996- ctx . RequestServices . GetService < Microsoft . AspNetCore . Hosting . IApplicationLifetime > ( ) . StopApplication ( ) ;
997+ ctx . RequestServices . GetService < IHostApplicationLifetime > ( ) . StopApplication ( ) ;
997998#else
998999 ctx . RequestServices . GetService < IHostApplicationLifetime > ( ) . StopApplication ( ) ;
9991000#endif
0 commit comments