-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Stop using 2.x packages in InProcessNewShimWebsite testasset #64120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 13 commits
c42ea80
d45b600
f115f9d
05a26be
26bdc25
b2a2ef1
1961b81
b4048bd
1436865
357903a
a654b70
f2b8c67
a9e3c6a
b5295b9
59d1e2f
747a0a3
548c503
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,9 +55,9 @@ | |
| serviceCollection.AddHttpContextAccessor(); | ||
| } | ||
| #if FORWARDCOMPAT | ||
| private async Task ContentRootPath(HttpContext ctx) => await ctx.Response.WriteAsync(ctx.RequestServices.GetService<Microsoft.AspNetCore.Hosting.IHostingEnvironment>().ContentRootPath); | ||
| private async Task ContentRootPath(HttpContext ctx) => await ctx.Response.WriteAsync(ctx.RequestServices.GetService<IWebHostEnvironment>().ContentRootPath); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we revert this and suppress the analyzer warnings here too? I think the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm fine with that - I was gonna trim it down to 1 branch, but I figured it'd be reasonable to keep the 2 in case the older & newer TFMs have different API surface. You want me to push a commit or were you already doing it?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
No. I haven't started it. And I think you're right that trimming it down to 1 branch makes more sense if that's possible. I think the FORWARDCOMPAT constant was mostly added to avoid build time errors on down-level frameworks that didn't have the new types. Now that |
||
|
|
||
| private async Task WebRootPath(HttpContext ctx) => await ctx.Response.WriteAsync(ctx.RequestServices.GetService<Microsoft.AspNetCore.Hosting.IHostingEnvironment>().WebRootPath); | ||
| private async Task WebRootPath(HttpContext ctx) => await ctx.Response.WriteAsync(ctx.RequestServices.GetService<IWebHostEnvironment>().WebRootPath); | ||
| #else | ||
| private async Task ContentRootPath(HttpContext ctx) => await ctx.Response.WriteAsync(ctx.RequestServices.GetService<IWebHostEnvironment>().ContentRootPath); | ||
|
|
||
|
|
@@ -175,7 +175,7 @@ | |
| public Task CreateFile(HttpContext context) | ||
| { | ||
| #if FORWARDCOMPAT | ||
| var hostingEnv = context.RequestServices.GetService<Microsoft.AspNetCore.Hosting.IHostingEnvironment>(); | ||
| var hostingEnv = context.RequestServices.GetService<IWebHostEnvironment>(); | ||
| #else | ||
| var hostingEnv = context.RequestServices.GetService<IWebHostEnvironment>(); | ||
| #endif | ||
|
|
@@ -476,16 +476,16 @@ | |
|
|
||
| // Both default and StringValues.Empty should unset the header, allowing it to be added again. | ||
| ArgumentException duplicateKeyException = null; | ||
| ctx.Request.Headers.Add(headerName, "test"); | ||
|
Check failure on line 479 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs
|
||
| ctx.Request.Headers[headerName] = default; | ||
| ctx.Request.Headers.Add(headerName, "test"); | ||
|
Check failure on line 481 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs
|
||
| ctx.Request.Headers[headerName] = StringValues.Empty; | ||
| ctx.Request.Headers.Add(headerName, "test"); | ||
|
Check failure on line 483 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs
|
||
|
|
||
| try | ||
| { | ||
| // Repeated adds should throw. | ||
| ctx.Request.Headers.Add(headerName, "test"); | ||
|
Check failure on line 488 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs
|
||
| } | ||
| catch (ArgumentException ex) | ||
| { | ||
|
|
@@ -597,7 +597,7 @@ | |
| { | ||
| await ctx.Response.WriteAsync("test1"); | ||
| #if FORWARDCOMPAT | ||
| var lifetime = ctx.RequestServices.GetService<Microsoft.AspNetCore.Hosting.IApplicationLifetime>(); | ||
| var lifetime = ctx.RequestServices.GetService<IHostApplicationLifetime>(); | ||
| #else | ||
| var lifetime = ctx.RequestServices.GetService<IHostApplicationLifetime>(); | ||
| #endif | ||
|
|
@@ -680,8 +680,9 @@ | |
| private async Task ReadAndWriteEchoLinesNoBuffering(HttpContext ctx) | ||
| { | ||
| #if FORWARDCOMPAT | ||
| var feature = ctx.Features.Get<IHttpBufferingFeature>(); | ||
| feature.DisableResponseBuffering(); | ||
| var feature = ctx.Features.Get<IHttpResponseBodyFeature>(); | ||
| feature.DisableBuffering(); | ||
| Assert.True(ctx.Request.CanHaveBody()); | ||
| #else | ||
| var feature = ctx.Features.Get<IHttpResponseBodyFeature>(); | ||
| feature.DisableBuffering(); | ||
|
|
@@ -993,7 +994,7 @@ | |
| { | ||
| await ctx.Response.WriteAsync("Shutting down"); | ||
| #if FORWARDCOMPAT | ||
| ctx.RequestServices.GetService<Microsoft.AspNetCore.Hosting.IApplicationLifetime>().StopApplication(); | ||
| ctx.RequestServices.GetService<IHostApplicationLifetime>().StopApplication(); | ||
| #else | ||
| ctx.RequestServices.GetService<IHostApplicationLifetime>().StopApplication(); | ||
| #endif | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NetMinimum is net8.0 currently, and is controlled by Arcade