Skip to content

InvalidOperationException: The response cannot be cleared, it has already started sending. #184

@lounge

Description

@lounge

We are seeing the same issue as described in ticket #101. When we apply the proposed solution (change the order of the middlewares), the error stops occurring, but the redirects and custom providers stop working instead.

It seems there was a similar issue that was fixed in #24, but that fix was for HttpContextExtensions.SetStatusCode, not HttpContextExtensions.Redirect.

Shouldn't the Redirect method in HttpContextExtensions
also check context.Response.HasStarted?

We are seeing this in both version 5 and 6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions