Fix DevServer version pin in template test infrastructure#66303
Merged
ilonatommy merged 2 commits intodotnet:mainfrom Apr 14, 2026
Merged
Fix DevServer version pin in template test infrastructure#66303ilonatommy merged 2 commits intodotnet:mainfrom
ilonatommy merged 2 commits intodotnet:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes Blazor WASM template test infrastructure so it correctly pins Microsoft.AspNetCore.Components.WebAssembly.DevServer to the locally-built package version, preventing NU1603 restore failures when a higher-precedence preview package exists on a feed.
Changes:
- Switch the version passed into the generated
Directory.Build.targetstemplate from$(MicrosoftAspNetCoreComponentsWebAssemblyDevServerVersion)(not available in the test build context) to$(PackageVersion)(available via repo versioning).
The version pin added in dotnet#65784 to prevent NU1603 errors during Blazor WASM template tests never worked because is not an MSBuild property available in the test build context. It is only computed dynamically during template packing by GenerateContent.targets. This caused the generated Directory.Build.targets to contain an empty condition ('' != '') and empty version range ([]), making the pin a no-op. When a darc feed contains a preview-versioned DevServer package that outranks the locally-built CI package in SemVer (e.g. 11.0.0-preview.1 > 11.0.0-ci), NuGet resolves to the feed version, triggering NU1603 which is fatal with TreatWarningsAsErrors. Fix: use which is always available in the build context and matches the DevServer package version since all aspnetcore packages share the same version. Fixes dotnet#66293 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
eafe6c0 to
f07b00e
Compare
Remove quarantine attributes added in dotnet#66294 since the root cause (broken DevServer version pin) is fixed in the previous commit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
f07b00e to
87f879d
Compare
This was referenced Apr 14, 2026
Open
dariatiurina
approved these changes
Apr 14, 2026
This was referenced Apr 21, 2026
github-actions Bot
added a commit
that referenced
this pull request
Apr 21, 2026
Both classes are failing again in build 1388488 after being unquarantined in #66303. The DevServer version pin fix may not have fully resolved the underlying issue. - Re-quarantine WebWorkerTemplateE2ETest at class level (issue #66292) - Re-quarantine BlazorWasmTemplateTest at class level (issue #66293) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
DeagleGross
pushed a commit
that referenced
this pull request
Apr 21, 2026
…emplateE2ETest (#66404) Both classes are failing again in build 1388488 after being unquarantined in #66303. The DevServer version pin fix may not have fully resolved the underlying issue. - Re-quarantine WebWorkerTemplateE2ETest at class level (issue #66292) - Re-quarantine BlazorWasmTemplateTest at class level (issue #66293) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #66293
Fixes #66292
The version pin added in #65784 to prevent NU1603 errors during Blazor WASM template tests never worked because
$(MicrosoftAspNetCoreComponentsWebAssemblyDevServerVersion)is not an MSBuild property available in the test build context - it is only computed dynamically during template packing byGenerateContent.targetsvia_GetPackageVersionInfo.This caused the generated
Directory.Build.targetsto contain:When a darc feed contains a preview-versioned DevServer package that outranks the locally-built CI package in SemVer (e.g.
11.0.0-preview.1>11.0.0-ci), NuGet resolves to the feed version, triggering NU1603 which is fatal withTreatWarningsAsErrors.Fix
Fix version pin: Use
$(PackageVersion)instead of the undefined property.$(PackageVersion)is always available in the build context and matches the DevServer package version (all aspnetcore packages share the same version fromeng/Versions.props).Unquarantine tests: Remove quarantine attributes from
BlazorWasmTemplateTestandWebWorkerTemplateE2ETest(added in [test-quarantine] Quarantine BlazorWasmTemplateTest and re-quarantine WebWorkerTemplateE2ETest; unquarantine ShutdownTests #66294) since the root cause is fixed.After the fix, the generated file correctly contains:
Testing
Directory.Build.targetsnow has the correct version pinBlazorWasmStandaloneTemplate_Works- passes