Skip to content

fix: work around DevFlow.Blazor packaging bug breaking Windows build#484

Merged
PureWeen merged 1 commit intomainfrom
fix/devflow-blazor-wwwroot-build
Apr 7, 2026
Merged

fix: work around DevFlow.Blazor packaging bug breaking Windows build#484
PureWeen merged 1 commit intomainfrom
fix/devflow-blazor-wwwroot-build

Conversation

@PureWeen
Copy link
Copy Markdown
Owner

@PureWeen PureWeen commented Apr 3, 2026

Summary

  • The Microsoft.Maui.DevFlow.Blazor preview NuGet package has a packaging bug: its PRI file references chobitsu.js and Microsoft.Maui.DevFlow.Blazor.lib.module.js under lib/.../wwwroot/, but the files only exist under staticwebassets/
  • This causes MSB3030 copy errors on Windows builds, completely blocking relaunch.ps1 and any Windows debug builds
  • Adds a build target (_FixDevFlowBlazorWwwroot) that copies the missing files from staticwebassets/ to the expected wwwroot/ location before the content copy step runs

Test plan

  • dotnet build PolyPilot.csproj -f net10.0-windows10.0.19041.0 -c Debug succeeds with 0 errors
  • relaunch.ps1 completes build + launch cycle successfully
  • Remove the workaround target once an updated DevFlow.Blazor package ships the fix upstream

@PureWeen PureWeen force-pushed the fix/devflow-blazor-wwwroot-build branch 2 times, most recently from 6c8c15d to 86c7f98 Compare April 4, 2026 22:48
@PureWeen
Copy link
Copy Markdown
Owner Author

PureWeen commented Apr 7, 2026

Update: This PR was briefly closed as superseded by #532, but reopened because #532 only fixes Release builds (DevFlow is now Debug-only). This PR is still needed for local Windows Debug builds where the DevFlow.Blazor packaging bug causes MSB3030 errors. Rebased on latest main with source-existence guards added.

@PureWeen PureWeen closed this Apr 7, 2026
@PureWeen PureWeen reopened this Apr 7, 2026
The Microsoft.Maui.DevFlow.Blazor NuGet package ships its static web
assets (chobitsu.js, lib.module.js) under staticwebassets/ but the
generated PRI references them under lib/.../wwwroot/ — a path that
doesn't exist in the package. This causes MSB3030 copy errors on
Windows builds.

Add a build target that copies the files from staticwebassets/ to the
expected wwwroot/ location before the content copy step runs.
@PureWeen PureWeen force-pushed the fix/devflow-blazor-wwwroot-build branch from 86c7f98 to 5c7e0af Compare April 7, 2026 20:33
@PureWeen PureWeen merged commit 7dae1fa into main Apr 7, 2026
@PureWeen PureWeen deleted the fix/devflow-blazor-wwwroot-build branch April 7, 2026 20:44
@PureWeen
Copy link
Copy Markdown
Owner Author

PureWeen commented Apr 7, 2026

🔍 Multi-Model Code Review — PR #484

PR: fix: work around DevFlow.Blazor packaging bug breaking Windows build
Branch: fix/devflow-blazor-wwwroot-buildmain
Changes: +25 / -0 across 1 file (PolyPilot.csproj)
CI Status: ⚠️ No CI checks reported on this branch
Prior Reviews: None (author comment clarifies this is still needed for Windows Debug builds alongside #532)


🟡 MODERATE — Hardcoded package version creates silent maintenance trap

File: PolyPilot/PolyPilot.csproj_FixDevFlowBlazorWwwroot target
Flagged by: 3/3 reviewers

The version 0.1.0-preview.4.26202.3 is hardcoded in the _DevFlowPkgRoot path, duplicating the version on the PackageReference (lines 86-87). When someone bumps the DevFlow package, the Exists() guards silently make the target a no-op — the original MSB3030 error resurfaces with zero indication the workaround exists and needs updating.

The comment says this is by design ("no-op when the package version changes"), but this conflates two scenarios: (a) upstream bug fixed (desired no-op), and (b) version bumped but bug persists (silent breakage). Both look identical.

The hardcoded TFM path lib\net10.0-windows10.0.19041\... in _DevFlowWwwrootDest has the same fragility — a TFM change silently breaks the workaround.

Suggested fix: Add GeneratePathProperty="true" to the DevFlow.Blazor PackageReference (already used in PolyPilot.Gtk.csproj:60 for precedent), then replace _DevFlowPkgRoot with $(PkgMicrosoft_Maui_DevFlow_Blazor). This auto-tracks version bumps while the Exists() guard still makes it a no-op when the upstream fix ships.


🟡 MODERATE — Target mutates the global NuGet package cache

File: PolyPilot/PolyPilot.csprojMakeDir and Copy tasks
Flagged by: 3/3 reviewers

The target writes files into $(NuGetPackageRoot), which is the shared, global NuGet cache (~/.nuget/packages/). Concerns:

  1. Cross-project pollution — other projects referencing the same DevFlow.Blazor version will see the injected files
  2. CI read-only caches — restored NuGet caches may have read-only attributes, causing UnauthorizedAccessException with no diagnostic (no ContinueOnError)
  3. Concurrent build races — the !Exists() guards are non-atomic with the file operations (low practical impact since SkipUnchangedFiles provides idempotency)

Suggested fix: For a temporary workaround, this is pragmatically acceptable — but add ContinueOnError="WarnAndContinue" to the MakeDir and Copy tasks with a <Warning> explaining the fallback, so permission failures on CI don't produce opaque errors. If the workaround is expected to live longer, consider copying into $(IntermediateOutputPath) instead.


✅ What looks good

  • Condition logicDebug + windows platform correctly scopes the fix to where the bug manifests
  • Source-existence guards — all three tasks have Exists() conditions preventing errors when the package layout changes
  • IdempotencySkipUnchangedFiles="true" + destination existence checks prevent repeated work
  • Path separators\ is fine since the target only runs on Windows
  • Comment documentation — clearly explains the bug, scope, and expected removal conditions

🏁 Recommendation: ⚠️ Request Changes

  1. 🟡 MODERATE: Use GeneratePathProperty="true" on the PackageReference to avoid hardcoded version/TFM — single source of truth for the package path
  2. 🟡 MODERATE: Add ContinueOnError="WarnAndContinue" to MakeDir/Copy tasks for CI resilience

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant