Skip to content

[release/10.0] Fix Blazor WASM template tests NU1603 with DevServer version pinning#65781

Merged
lewing merged 5 commits intorelease/10.0from
lewing/fix-devserver-nu1603
Mar 16, 2026
Merged

[release/10.0] Fix Blazor WASM template tests NU1603 with DevServer version pinning#65781
lewing merged 5 commits intorelease/10.0from
lewing/fix-devserver-nu1603

Conversation

@lewing
Copy link
Copy Markdown
Member

@lewing lewing commented Mar 15, 2026

Summary

Pin the DevServer package to the exact locally-built version in the template test infrastructure so that stable versions from darc feeds don't cause NU1603.

Problem

When a VMR official build publishes a stable DevServer package (e.g. 10.0.6) to a darc feed, NuGet prefers it over the locally-built prerelease (10.0.6-ci) because stable > prerelease in SemVer. This triggers NU1603, which becomes fatal with TreatWarningsAsErrors.

Recurs on every servicing patch — not just 10.0.6.

Fix

Two changes:

  1. PrepareForTest.targets — pipe MicrosoftAspNetCoreComponentsWebAssemblyDevServerVersion through to Directory.Build.props.in
  2. Directory.Build.props.in — add <PackageReference Update> with exact version range [x.y.z-ci]

This forces NuGet to use the locally-built package during template tests. The shipped template continues using >= semantics for customers.

Fixes #65701

lewing and others added 3 commits March 9, 2026 22:30
Move tcs.TrySetResult() after StopConnectionAsync so the response
handler stays blocked until the connection has stopped. This prevents
response HEADERS from being written before the GOAWAY frame, which
caused the test to intermittently fail with 'Expected: GOAWAY,
Actual: HEADERS'.

This is the same fix pattern applied in #65454 for the sibling
AdditionalDataFrames and AdditionalTrailerFrames tests, and in #57450
for the AdditionalWindowUpdateFrame test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Wait for the request to be aborted before releasing the application delegate gate in RST_STREAM_IncompleteRequest_AdditionalResetFrame_IgnoreAdditionalReset. This preserves the test intent while avoiding both the HEADERS-vs-GOAWAY race and the shutdown timeout.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pin the DevServer package to the exact locally-built version in the
template test infrastructure so that stable versions from darc feeds
(which outrank prerelease versions in SemVer) don't cause NU1603.

With TreatWarningsAsErrors enabled, NU1603 becomes fatal, breaking
BlazorWasmStandaloneTemplate_Works and related tests whenever a VMR
official build publishes a stable DevServer to a darc feed.

The fix pipes MicrosoftAspNetCoreComponentsWebAssemblyDevServerVersion
through PrepareForTest.targets into Directory.Build.props.in, which
adds a PackageReference Update with an exact version range [x.y.z-ci].
This ensures the locally-built package is always used during tests.
The shipped template continues using >= semantics for customers.

Fixes #65701
@lewing lewing requested a review from tdykstra as a code owner March 15, 2026 02:51
Copilot AI review requested due to automatic review settings March 15, 2026 02:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@github-actions github-actions bot added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Mar 15, 2026
@lewing lewing changed the base branch from main to release/10.0 March 15, 2026 02:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses Blazor WASM template test restore failures (NU1603) by pinning the WebAssembly DevServer package to the exact locally-built version during template test runs, preventing NuGet from preferring stable versions from darc feeds over prerelease -ci builds.

Changes:

  • Pass MicrosoftAspNetCoreComponentsWebAssemblyDevServerVersion through the template test file-generation pipeline.
  • Add a test-only PackageReference version pin for Microsoft.AspNetCore.Components.WebAssembly.DevServer using an exact version range.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets Pipes the DevServer version into the Directory.Build.props.in template generation.
src/ProjectTemplates/TestInfrastructure/Directory.Build.props.in Attempts to pin DevServer to an exact version range for template test restores.

You can also share your feedback on Copilot code review. Take the survey.

PackageReference Update in Directory.Build.props runs before the
project file, so it cannot affect items declared in the project.
Move to Directory.Build.targets.in which is imported after, and
pipe the version variable to the targets template instead.
@lewing lewing added the tell-mode Indicates a PR which is being merged during tell-mode label Mar 15, 2026
@lewing lewing changed the title Fix Blazor WASM template tests NU1603 with DevServer version pinning [release/10.0] Fix Blazor WASM template tests NU1603 with DevServer version pinning Mar 15, 2026
@lewing
Copy link
Copy Markdown
Member Author

lewing commented Mar 15, 2026

/backport to main

@github-actions
Copy link
Copy Markdown
Contributor

Started backporting to main (link to workflow run)

@github-actions
Copy link
Copy Markdown
Contributor

@lewing backporting to main failed, the patch most likely resulted in conflicts. Please backport manually!

git am output
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Fix race in RST_STREAM_IncompleteRequest_AdditionalResetFrame test
Using index info to reconstruct a base tree...
M	src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs
CONFLICT (content): Merge conflict in src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2ConnectionTests.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Fix race in RST_STREAM_IncompleteRequest_AdditionalResetFrame test
Error: The process '/usr/bin/git' failed with exit code 128

Link to workflow output

@lewing lewing removed request for a team, JamesNK and tdykstra March 16, 2026 14:19
@lewing lewing merged commit e344b32 into release/10.0 Mar 16, 2026
23 of 28 checks passed
@lewing lewing deleted the lewing/fix-devserver-nu1603 branch March 16, 2026 16:37
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0.5 milestone Mar 16, 2026
@wtgodbe wtgodbe modified the milestones: 10.0.5, 10.0.6 Mar 17, 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 tell-mode Indicates a PR which is being merged during tell-mode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Known Build Error] Blazor WASM template tests fail with NU1603: DevServer 10.0.6-ci not found, 10.0.6 resolved instead

4 participants