Skip to content

IIS in-process hosting returns HTTP 500 after runtime-async enablement #126925

Open

Description

@wtgodbe

Description

After enabling runtime-async unconditionally in System.Private.CoreLib (#126680, #126594), IIS in-process hosted ASP.NET Core applications return HTTP 500 for all requests. The application starts successfully (ANCM logs confirm "started the coreclr in-process successfully") but every subsequent HTTP request fails with 500 Internal Server Error — the managed request pipeline never produces a successful response.

This was discovered via a codeflow PR in dotnet/aspnetcore (#66239) that brings in runtime changes from commit range 655c517c...ce3e7165.

Reproduction

Failing test: IIS.NewShim.FunctionalTests.StartupTests.StartsWithPortableAndBootstraperExe

Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1378813&view=results

Helix job: db741402-6d7f-4dfc-bea7-30db6cf73900, work item IIS.NewShim.FunctionalTests--net11.0

The test deploys an ASP.NET Core app (InProcessWebSite) to IIS using the in-process hosting model, then sends GET requests to /HelloWorld expecting a 200 response with body "Hello World". Instead, every request returns 500 Internal Server Error.

Key observations from the Helix logs

The ANCM (ASP.NET Core Module) logs show the app starts without errors:

[aspnetcorev2_inprocess.dll] In-process callbacks set
[aspnetcorev2_inprocess.dll] Event Log: 'Application '...' started the coreclr in-process successfully.'

But all HTTP requests return 500:

StatusCode: 500, ReasonPhrase: 'Internal Server Error', Version: 1.1
  Server: Microsoft-IIS/10.0

The test retries 10 times over ~11 seconds, receiving 500 each time, then fails:

System.InvalidOperationException : Didn't get response that satisfies predicate after 10 retries

No exception or error message is logged by the application itself — the 500 appears to come from the request pipeline silently failing to complete.

Suspected cause

The runtime diff between the working and broken builds includes two commits that enable runtime-async unconditionally:

IIS in-process hosting has a complex interaction between the native ANCM module and managed async code — the ASP.NET Core request pipeline runs async methods within the IIS worker process, with continuations that cross native/managed boundaries. A change in how async continuations are scheduled or how tasks complete at the JIT level could cause the request handler to fail without completing the response.

Suggested investigation

  1. Confirm by running the failing test with DOTNET_JitEnableRuntimeAsync=0 — if the test passes with runtime-async disabled, this confirms the root cause.
  2. Investigate the interaction between runtime-async and the IIS in-process hosting model's IHttpApplication.ProcessRequestAsync / IISHttpContext pipeline.

Environment

Activity

  1. added
    untriaged
    on Apr 14, 2026
  2. dotnet-policy-service commented on Apr 14, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @karelz, @dotnet/ncl
    See info in area-owners.md if you want to be subscribed.

  3. wtgodbe commented on Apr 15, 2026

    @wtgodbe
    MemberAuthor

    CC @agocke for runtime-async

  4. dotnet-policy-service commented on Apr 15, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @agocke
    See info in area-owners.md if you want to be subscribed.

  5. ManickaP commented on Apr 15, 2026

    @ManickaP
    Member

    I've changed the area, hopefully correctly. Looking at the commits diff, there's no networking change that looks suspicious or could be source of this problem IMHO (only disabled tests, improved exception in Smtp).

  6. 2 remaining items

  7. self-assigned this
    on Apr 16, 2026
  8. dotnet-policy-service commented on Apr 16, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/area-extensions-logging
    See info in area-owners.md if you want to be subscribed.

  9. assigned and unassigned on Apr 16, 2026
  10. tarekgh commented on Apr 16, 2026

    @tarekgh
    Member

    I added my analysis in the comment #126995 (comment) as I think this is same cause. We need to wait @ericstj to advise the course of action here.

  11. removed
    untriaged
    on Apr 23, 2026
  12. added this to the Future milestone on Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

  • Status
    No status

Relationships

None yet

Development

No branches or pull requests

Issue actions