Skip to content

HttpContext.Current should not be read-only #400

@afshinm

Description

@afshinm

Describe the bug

Looking at the System.Web implementation, it seems like HttpContext.Current is not read-only https://github.com/microsoft/referencesource/blob/master/System.Web/HttpContext.cs#L566-L579 which is different than our implementation https://github.com/dotnet/systemweb-adapters/blob/main/src/Microsoft.AspNetCore.SystemWebAdapters/HttpContext.cs#L31

To Reproduce

Try HttpContext.Current = new HttpContext(...); and you will get this error "CS0200: Property or indexer 'HttpContext.Current' cannot be assigned to -- it is read only"

Exceptions (if any)

None, causes build error.

Further technical details

Please include the following if applicable:

ASP.NET Framework Application:

  • Technologies and versions used (i.e. MVC/WebForms/etc):
  • .NET Framework Version: 4.7.2
  • IIS Version: 10
  • Windows Version: 11

ASP.NET Core Application:

  • Targeted .NET version: 6.0
  • .NET SDK version: 1.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Triage 🔍Label added to new issues which need Triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions