Skip to content

[release/10.0] Fix empty PathBase on first IIS in-process request after startup - #69712

Merged
wtgodbe merged 2 commits into
release/10.0from
backport/pr-69398-to-release/10.0
Oct 15, 2026
Merged

wtgodbe merged 2 commits into
release/10.0from
backport/pr-69398-to-release/10.0

Conversation

@github-actions

@github-actions github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #69398 to release/10.0

/cc @halter73 @Souheyl7Gouadria

Fix empty PathBase on first IIS in-process request after startup

Initialize the IIS virtual path before requests can be dispatched.

Description

IISHttpServer.StartAsync registers native callbacks before reading the application's virtual path. Registration enables ANCM to dispatch requests, so a request constructed during that window sees an empty PathBase and an unsplit Path. For an application deployed at /myapi, /myapi/v1/ping consequently fails to match the /v1/ping endpoint.

Pass pwzVirtualApplicationPath through an internal IISServerOptions property using the existing native configuration snapshot in UseIIS(). The server resolves these options during construction, before callback registration. Remove the redundant native property query from StartAsync rather than moving it back before registration, preserving the shutdown-race protection introduced by #60399.

This is an unchanged backport of the three-file fix merged in #69398. It does not include the separate, pre-existing server-address publication issue tracked in #69704.

Fixes #69392

Customer Impact

ASP.NET Core 10.0 applications hosted in-process under an IIS virtual application path can intermittently return 404 for the request that cold-starts the application, including after deployment or an app-pool idle timeout. Subsequent identical requests route correctly. This can affect any application using that deployment configuration; the reporter observed it in two applications.

The reported workaround uses an IStartupFilter and reflection over internal IIS server state to repair the request path before routing. Although it mitigates the failure, it depends on implementation details and requires application changes. Correct framework initialization restores the working 9.0 behavior without requiring that workaround.

Regression?

  • Yes
  • No

Regression from ASP.NET Core 9.0. Commit 512209d2ccd8df506b3c302385fa840ff09d76d7 (#60399) introduced the ordering change during 10.0 development. It is absent from 10.0 Preview 1 and present in Preview 2. The failure was reproduced on 10.0.12; the same controlled startup interleaving succeeds on 9.0.20.

Risk

  • High
  • Medium
  • Low

The change only moves the source of the virtual-path value into the existing startup configuration-to-options flow. It adds no public API, dependency, native ABI, packaging change, or per-request native call. Request path splitting and native shutdown callbacks are unchanged. Reusing the already-captured native snapshot removes a shutdown-sensitive query instead of reinstating it in the server constructor. The fix has already merged to main.

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

No package, dependency, project, shared-framework composition, or native binary layout changes. The new option is internal.

@halter73 halter73 added the Servicing-consider Shiproom approval is required for the issue label Oct 7, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hi @github-actions[bot]. Please make sure you've updated the PR description to use the Shiproom Template. Also, make sure this PR is not marked as a draft and is ready-to-merge.

To learn more about how to prepare a servicing PR click here.

@artl93 artl93 removed their assignment Oct 8, 2026
@artl93
artl93 requested a review from tkapin October 8, 2026 21:43
@artl93

artl93 commented Oct 8, 2026

Copy link
Copy Markdown
Member

Please work with @tkapin on approvals.

@artl93
artl93 requested review from artl93 and removed request for tkapin October 8, 2026 23:22

@artl93 artl93 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved. Regression. Customer Reported.

@ViveliDuCh ViveliDuCh added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Oct 12, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hi @github-actions[bot]. This PR was just approved to be included in the upcoming servicing release. Somebody from the @dotnet/aspnet-build team will get it merged when the branches are open. Until then, please make sure all the CI checks pass and the PR is reviewed.

@wtgodbe
wtgodbe merged commit b6da38d into release/10.0 Oct 15, 2026
31 checks passed
@wtgodbe
wtgodbe deleted the backport/pr-69398-to-release/10.0 branch October 15, 2026 15:05
@dotnet-policy-service dotnet-policy-service Bot added this to the 10.0.14 milestone Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Servicing-approved Shiproom has approved the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants