Application Name: OrchardCMS
OS: Windows10 21h2
CPU: x64
App Source Checking at: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1746818
Verify Scenarios:
1). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.100-preview.1.23107.4 + app (default 6.0): Pass
2). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.100-preview.1.23107.4 + app (retarget 7.0): Pass
3). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.100-preview.1.23107.4 + app (retarget 8.0): Fail
4). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.100-preview.1.23112. + app (retarget 8.0): Fail
Repro steps:
- Copy app source to local machine.
- Replace net6.0 to net8.0 in src\OrchardCore.Build\Dependencies.AspNetCore.props.
- Build the OrchardCore.Cms.Web in Visual Studio.
Expected Result:
Build successful.
Actual Result:

Minimal Repro sample:
Minimal repro sample attached.
WebApplication1.zip
Repro steps:
- Create a default .net 7.0 AspNetCore app.
- Add a new Class1.cs.
- Add following code in Class1.cs
using Microsoft.Net.Http.Headers;
public class Class: Controller
{
[Route("test")]
public void test1(HttpContext httpContext)
{
httpContext.Response.Headers.Add(“”, "");
//Change Add to Append, error will disappear
//httpContext.Response.Headers.Append(“”, "");
}
[Route("test")]
public void test2()
{
}
}
- Build the project, there is no error in Error List windows of Visual Studio.
- Retarget the project to net8.0.
- Rebuild the project.
Expected Result:
Build successful.
Actual Result:
Build with error:
ASP0019 Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key.
ASP0023 Route 'test' conflicts with another action route. An HTTP request that matches multiple routes results in an ambiguous match error. Fix the conflict by changing the route's pattern, HTTP method, or route constraints.
ASP0023 Route 'test' conflicts with another action route. An HTTP request that matches multiple routes results in an ambiguous match error. Fix the conflict by changing the route's pattern, HTTP method, or route constraints.
Findings:
According to the this document: ASP0019: Suggest using IHeaderDictionary.Append or the indexer | Microsoft Learn We change the Add to Append, the warning ASP0019 disappeared.
public void test1(HttpContext httpContext)
{
//httpContext.Response.Headers.Add(“”, "");
//Change Add to Append, error will disappear
httpContext.Response.Headers.Append(“”, "");
}
And according to this github link: https://github.com/dotnet/dotnet/blob/ae22535816f1b667a9194e776b4ea63d2ee305f5/src/aspnetcore/src/Framework/AspNetCoreAnalyzers/src/Analyzers/DiagnosticDescriptors.cs ASP0023 is defined in this DiagnosticDescriptors.cs file, but we didn't find the relevant released doc for error ASP0023.
Dotnet Info:
.NET SDK:
Version: 8.0.100-preview.1.23107.4
Commit: 5a2156073c
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.100-preview.1.23107.4\
Host:
Version: 8.0.0-preview.1.23104.3
Architecture: x64
Commit: 6507a44770
.NET SDKs installed:
8.0.100-preview.1.23107.4 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.0-preview.1.23105.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.0-preview.1.23104.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.0-preview.1.23106.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
@dotnet-actwx-bot @dotnet/compat
Application Name: OrchardCMS
OS: Windows10 21h2
CPU: x64
App Source Checking at: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1746818
Verify Scenarios:
1). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.100-preview.1.23107.4 + app (default 6.0): Pass
2). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.100-preview.1.23107.4 + app (retarget 7.0): Pass
3). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.100-preview.1.23107.4 + app (retarget 8.0): Fail
4). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.100-preview.1.23112. + app (retarget 8.0): Fail
Repro steps:
Expected Result:
Build successful.
Actual Result:

Minimal Repro sample:
Minimal repro sample attached.
WebApplication1.zip
Repro steps:
Expected Result:
Build successful.
Actual Result:
Build with error:
Findings:
According to the this document: ASP0019: Suggest using IHeaderDictionary.Append or the indexer | Microsoft Learn We change the Add to Append, the warning ASP0019 disappeared.
And according to this github link: https://github.com/dotnet/dotnet/blob/ae22535816f1b667a9194e776b4ea63d2ee305f5/src/aspnetcore/src/Framework/AspNetCoreAnalyzers/src/Analyzers/DiagnosticDescriptors.cs ASP0023 is defined in this DiagnosticDescriptors.cs file, but we didn't find the relevant released doc for error ASP0023.
@dotnet-actwx-bot @dotnet/compat