Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Project="..\..\..\..\build\testsite.props" />

<PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<TargetFrameworks>$(DefaultNetCoreTargetFramework);$(NetMinimum)</TargetFrameworks>
Copy link
Member Author

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

<AssemblyName>InProcessWebSite</AssemblyName>
<DefineConstants>FORWARDCOMPAT</DefineConstants>
<CompileUsingReferenceAssemblies>false</CompileUsingReferenceAssemblies>
Expand All @@ -27,38 +27,25 @@
<None Include="..\InProcessWebSite\web.config" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<ItemGroup>
<!-- This package is hard-coded to the 2.2.0 package as a part of ensuring ANCM stays forward compatible. -->
<PackageReference Include="Microsoft.AspNetCore.Server.IIS" Version="2.2.6">
<AllowExplicitReference>true</AllowExplicitReference>
</PackageReference>
<PropertyGroup Condition="'$(TargetFramework)' == '$(NetMinimum)'">
<UseAspNetCoreSharedRuntime>true</UseAspNetCoreSharedRuntime>
<DoNotApplyWorkaroundsToMicrosoftAspNetCoreApp>true</DoNotApplyWorkaroundsToMicrosoftAspNetCoreApp>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
<Reference Include="Microsoft.AspNetCore.Server.IIS" />
<Reference Include="Microsoft.AspNetCore.Hosting" />
<Reference Include="Microsoft.AspNetCore.ResponseCompression" />
<Reference Include="Microsoft.AspNetCore.Server.IISIntegration" />
<Reference Include="Microsoft.AspNetCore.Server.Kestrel" />
<Reference Include="Microsoft.AspNetCore.Server.Kestrel.Core" />
<Reference Include="Microsoft.AspNetCore.HttpsPolicy" />
<Reference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" />
<Reference Include="Microsoft.Extensions.Configuration.Json" />
<Reference Include="Microsoft.Extensions.Logging.Console" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.2.0" >
<AllowExplicitReference>true</AllowExplicitReference>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.ResponseCompression" Version="2.2.0" >
<AllowExplicitReference>true</AllowExplicitReference>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="2.2.0" >
<AllowExplicitReference>true</AllowExplicitReference>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.2.0" >
<AllowExplicitReference>true</AllowExplicitReference>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.HttpsPolicy" Version="2.2.0" >
<AllowExplicitReference>true</AllowExplicitReference>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.2.0" >
<AllowExplicitReference>true</AllowExplicitReference>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" >
<AllowExplicitReference>true</AllowExplicitReference>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.2.0" >
<AllowExplicitReference>true</AllowExplicitReference>
</PackageReference>
<Reference Include="xunit.assert" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
{
var ws = await Upgrade(context);
#if FORWARDCOMPAT
var appLifetime = app.ApplicationServices.GetRequiredService<Microsoft.AspNetCore.Hosting.IApplicationLifetime>();
var appLifetime = app.ApplicationServices.GetRequiredService<IHostApplicationLifetime>();
#else
var appLifetime = app.ApplicationServices.GetRequiredService<IHostApplicationLifetime>();
#endif
Expand Down Expand Up @@ -95,7 +95,7 @@

private void WebSocketUpgradeFails(IApplicationBuilder app)
{
app.Run(async context =>

Check failure on line 98 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.WebSockets.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: Ubuntu x64)

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.WebSockets.cs#L98

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.WebSockets.cs(98,17): error ASP0016: (NETCORE_ENGINEERING_TELEMETRY=Build) The method used to create a RequestDelegate returns Task<System.IO.Stream>. RequestDelegate discards this value. If this isn't intended then change the return type to non-generic Task or, if the delegate is a route handler, cast it to Delegate so the return value is written to the response. (https://aka.ms/aspnet/analyzers)

Check failure on line 98 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.WebSockets.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: Ubuntu x64)

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.WebSockets.cs#L98

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.WebSockets.cs(98,17): error ASP0016: (NETCORE_ENGINEERING_TELEMETRY=Build) The method used to create a RequestDelegate returns Task<System.IO.Stream>. RequestDelegate discards this value. If this isn't intended then change the return type to non-generic Task or, if the delegate is a route handler, cast it to Delegate so the return value is written to the response. (https://aka.ms/aspnet/analyzers)

Check failure on line 98 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.WebSockets.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: macOS)

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.WebSockets.cs#L98

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.WebSockets.cs(98,17): error ASP0016: (NETCORE_ENGINEERING_TELEMETRY=Build) The method used to create a RequestDelegate returns Task<System.IO.Stream>. RequestDelegate discards this value. If this isn't intended then change the return type to non-generic Task or, if the delegate is a route handler, cast it to Delegate so the return value is written to the response. (https://aka.ms/aspnet/analyzers)

Check failure on line 98 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.WebSockets.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: macOS)

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.WebSockets.cs#L98

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.WebSockets.cs(98,17): error ASP0016: (NETCORE_ENGINEERING_TELEMETRY=Build) The method used to create a RequestDelegate returns Task<System.IO.Stream>. RequestDelegate discards this value. If this isn't intended then change the return type to non-generic Task or, if the delegate is a route handler, cast it to Delegate so the return value is written to the response. (https://aka.ms/aspnet/analyzers)
{
var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>();
var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => upgradeFeature.UpgradeAsync());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Member

Choose a reason for hiding this comment

The 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 #if and the #else branches are currently identical.

Copy link
Member Author

Choose a reason for hiding this comment

The 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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want me to push a commit or were you already doing it?

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 net8.0 is the minimum TFM, most if not all of it is probably unnecessary.


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);

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: Ubuntu x64)

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L479

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(479,13): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)

Check failure on line 479 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: Ubuntu x64)

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L479

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(479,13): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)

Check failure on line 479 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: macOS)

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L479

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(479,13): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)

Check failure on line 479 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L479

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(479,13): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)

Check failure on line 479 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: macOS)

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L479

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(479,13): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)

Check failure on line 479 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L479

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(479,13): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)
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

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: Ubuntu x64)

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L481

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(481,13): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)

Check failure on line 481 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: Ubuntu x64)

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L481

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(481,13): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)

Check failure on line 481 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: macOS)

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L481

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(481,13): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)

Check failure on line 481 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L481

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(481,13): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)

Check failure on line 481 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: macOS)

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L481

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(481,13): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)

Check failure on line 481 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L481

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(481,13): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)
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

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: Ubuntu x64)

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L483

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(483,13): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)

Check failure on line 483 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: Ubuntu x64)

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L483

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(483,13): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)

Check failure on line 483 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: macOS)

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L483

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(483,13): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)

Check failure on line 483 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L483

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(483,13): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)

Check failure on line 483 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: macOS)

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L483

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(483,13): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)

Check failure on line 483 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L483

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(483,13): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)

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

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: Ubuntu x64)

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L488

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(488,17): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)

Check failure on line 488 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: Ubuntu x64)

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L488

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(488,17): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)

Check failure on line 488 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr (Tests: macOS)

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L488

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(488,17): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)

Check failure on line 488 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs

View check run for this annotation

Azure Pipelines / aspnetcore-quarantined-pr

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L488

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(488,17): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)

Check failure on line 488 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci (Build Test: macOS)

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L488

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(488,17): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)

Check failure on line 488 in src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs

View check run for this annotation

Azure Pipelines / aspnetcore-ci

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs#L488

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/Startup.cs(488,17): error ASP0019: (NETCORE_ENGINEERING_TELEMETRY=Build) Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key. (https://aka.ms/aspnet/analyzers)
}
catch (ArgumentException ex)
{
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down
Loading