Skip to content

[blazor] Use runtime dotnet.d.ts declaration in VMR builds - #70383

Closed
maraf wants to merge 1 commit into
dotnet:mainfrom
maraf:maraf-vmr-runtime-declarations
Closed

maraf wants to merge 1 commit into
dotnet:mainfrom
maraf:maraf-vmr-runtime-declarations

Conversation

@maraf

@maraf maraf commented Nov 7, 2026

Copy link
Copy Markdown
Member

[blazor] Use runtime source declarations in VMR builds

  • 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.

Use runtime's checked-in TypeScript declarations for VMR builds.

Description

Follow up on #70344 to fix the browser-wasm package restore failure in dotnet/dotnet#10802. VMR builds request runtime version 12.0.0-ci, but some verticals do not produce Microsoft.NETCore.App.Runtime.browser-wasm. Declaration extraction runs during general toolset initialization, so gating it only on the JavaScript build would not resolve the failure.

When DotNetBuildFromVMR is true, exclude the browser-wasm package download and copy runtime's checked-in src/runtime/src/native/libs/Common/JavaScript/loader/dotnet.d.ts from the VMR root supplied through SourceBuiltArtifactsBasePath. Standalone builds continue extracting declarations from the flowed browser runtime pack. Missing VMR roots or declarations fail explicitly rather than falling back to a package.

Track the declaration source and selected source path so source edits at an unchanged runtime version, missing output regeneration, and switching between VMR and standalone builds invalidate the shared npm input correctly. Preserve source-only/design-time exclusions, package timestamp handling, npm prerequisites, and template generation. Update the build documentation.

Validation: reproduced NU1102 on current main and verified that the same focused GenerateFiles restore passes with representative VMR properties and the actual declaration from VMR commit 4ecc70530be868a734810b1da40b83a352532315. A local MSBuild harness passed 22 incremental, exclusion, package-transition, and npm-prerequisite checks. Focused standalone and VMR wrapper restores with available flowed versions also passed. Full VMR Windows/Linux verticals and a full TypeScript build were not run. A broader wrapper using global 12.0.0-ci passed the repaired declaration/template stages but subsequently could not restore the VMR-produced Microsoft.NETCore.App.Ref for RepoTasks outside VMR.

Related: #70344 and dotnet/dotnet#10802. No separate bug issue is linked.

Note

This PR description was generated with the assistance of GitHub Copilot.

@maraf maraf self-assigned this Nov 7, 2026
@github-actions github-actions Bot added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Nov 7, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey @dotnet/aspnet-build, looks like this PR is something you want to take a look at.

@maraf
maraf requested a review from akoeplinger November 7, 2026 12:51
@maraf maraf changed the title [blazor] Use runtime source declarations in VMR builds [blazor] Use runtime dotnet.d.ts declaration in VMR builds Nov 7, 2026
@akoeplinger

Copy link
Copy Markdown
Member

This feels wrong too, repos shouldn’t be aware of the layout of other repos.

A better approach would be to put the file in a transport pack and flow it to aspnetcore (we just need to make sure it gets produced all the time, not just for browser-wasm)

@maraf

maraf commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

@akoeplinger Why the runtime pack itself can't be the "transport pack"?

@akoeplinger

Copy link
Copy Markdown
Member

because the runtime pack is only produced on the browser-wasm build job

@maraf maraf closed this Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants