Commit 965b95e
Fix duplicate StaticWebAsset Identity crash for multi-WASM-client solutions
PR #124125 changed WASM ContentRoot to per-item %(RootDir)%(Directory), which
makes each asset's Identity its real file path on disk. This is correct for
single-client scenarios and fixes SRI integrity on incremental builds, but
breaks multi-WASM-client solutions: NuGet cache pass-through files (JS, maps,
ICU, native wasm) resolve to the same Identity across projects, causing a
ToDictionary crash in DiscoverPrecompressedAssets.
The fix copies pass-through files from the shared NuGet cache to the per-project
$(IntermediateOutputPath)webcil/ directory (where webcil-converted files already
live), so every project gets a unique Identity. Satellite assemblies are placed
in culture subdirectories to match ConvertDllsToWebcil behavior.
This follows the pattern from sdk#52816 and Javier's SWA design principle that
Identity should match a real file on disk.
Fixes the aspnetcore codeflow regression where solutions hosting multiple Blazor
WASM clients fail with:
System.ArgumentException: An item with the same key has already been added.
Key: ...dotnet.js.map
at DiscoverPrecompressedAssets.Execute()
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 8151eb1 commit 965b95e
1 file changed
Lines changed: 32 additions & 0 deletions
File tree
- src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
363 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
364 | 396 | | |
365 | 397 | | |
366 | 398 | | |
| |||
0 commit comments