Skip to content

Build Site Extension XDT helper as AnyCPU - #70519

Merged
DeagleGross merged 1 commit into
dotnet:mainfrom
DeagleGross:deaglegross-vigilant-fortnight
Nov 12, 2026
Merged

DeagleGross merged 1 commit into
dotnet:mainfrom
DeagleGross:deaglegross-vigilant-fortnight

Conversation

@DeagleGross

@DeagleGross DeagleGross commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Build the Site Extension XDT helper as AnyCPU

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Keep the Site Extension transform loadable regardless of process architecture.

Description

  1. App: Minimal framework-dependent ASP.NET Core app, in-process hosting, processPath="dotnet", requiring a runtime newer than the platform provides.
  2. Azure: Windows App Service, Basic B1 plan, 32-bit worker, x86 ASP.NET Core Runtime Site Extension. Initially reproduced with platform 10.0.14 and extension 10.0.15.
  3. Deployment: ZIP-deployed the app. Also built the complete x86 extension package from this branch and uploaded its unmodified content/ payload as a named private Site Extension; a .NET 12 test app ran against those development runtimes.
  4. Error: The x86-only Microsoft.Web.Xdt.Extensions.dll fails to load during applicationHost.xdt processing with BadImageFormatException (0x800700C1). The transform fails, ANCM selects the older platform runtime, and startup returns HTTP 500.31.
  5. Fix: Set the helper's PlatformTarget to AnyCPU, retaining architecture-specific package paths and native components. Added a PE-format regression test, verified failing before and passing after for x86/x64 builds. In Azure, changing only this DLL to x86-only reproduced HTTP 500.31; restoring the packaged AnyCPU DLL applied the transform successfully and returned HTTP 200.
  6. Relation: This reproduces the issue's newer-extension-installed-but-platform-runtime-selected symptom. It does not establish the reported SDK 10.0.100-to-10.0.201 AnyCPU regression or confirm the reporter's transform failure.

Related #66203

Copilot AI balanced review requested due to automatic review settings November 11, 2026 21:33
@github-actions github-actions Bot added the area-unified-build Includes: work related to the unified build in dotnet/dotnet label Nov 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the AnyCPU helper change.

No open issues 🎉

What changed in this PR

Builds the Site Extension XDT helper as AnyCPU so App Service can load it even when the transform host and site worker have different architectures. Architecture-specific packaging and native components remain unchanged.

Changes:

  • Sets the helper’s PlatformTarget to AnyCPU, with a comment explaining why.
  • Adds a regression test that checks the helper’s PE metadata for architecture-neutral, IL-only output.
File Description
src/​SiteExtensions/​Microsoft.Web.Xdt.Extensions/​tests/​InsertOrAppendAttributeTests.cs Adds assertions for architecture-neutral assembly metadata.
src/​SiteExtensions/​Microsoft.Web.Xdt.Extensions/​src/​Microsoft.Web.Xdt.Extensions.csproj Sets and documents the AnyCPU compilation target.

Review effort: Balanced

@PureWeen

Copy link
Copy Markdown
Member

/review

@DeagleGross DeagleGross self-assigned this Nov 12, 2026
@DeagleGross
DeagleGross merged commit 6c02cb8 into dotnet:main Nov 12, 2026
28 checks passed
@DeagleGross
DeagleGross deleted the deaglegross-vigilant-fortnight branch November 12, 2026 18:38
@DeagleGross

Copy link
Copy Markdown
Member Author

/backport to release/10.0

@DeagleGross

Copy link
Copy Markdown
Member Author

/backport to release/11.0

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/10.0 (link to workflow run)

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/11.0 (link to workflow run)

@github-actions

Copy link
Copy Markdown
Contributor

✅ No documentation PR was created.

Confidence that documentation is needed: 8%

Confident no docs needed: bug fix to Site Extension XDT helper build architecture (AnyCPU) with regression test.

Documentation surfaces considered

  • Conceptual article: Not required — Internal build-target fix with test; no user-facing API or documented behavior change.
  • Migration guidance: Not required — No user action needed on upgrade.
  • Breaking change: Not required — No compatibility impact; fixes a load failure.

maraf pushed a commit that referenced this pull request Nov 23, 2026
maraf pushed a commit that referenced this pull request Nov 23, 2026

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — 3e62f622 Deployed Nov 12, 2026 by DeagleGross via conclusion #311
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-unified-build Includes: work related to the unified build in dotnet/dotnet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants