diff --git a/global.json b/global.json index f284cc45834019..18b37b79a47b34 100644 --- a/global.json +++ b/global.json @@ -1,11 +1,11 @@ { "sdk": { - "version": "11.0.100-preview.3.26161.119", + "version": "11.0.100-preview.3.26166.111", "allowPrerelease": true, "rollForward": "major" }, "tools": { - "dotnet": "11.0.100-preview.3.26161.119" + "dotnet": "11.0.100-preview.3.26166.111" }, "msbuild-sdks": { "Microsoft.DotNet.Arcade.Sdk": "11.0.0-beta.26166.111", diff --git a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets index 489ee3d833b725..b22a58454c1f0b 100644 --- a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets +++ b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets @@ -307,7 +307,7 @@ Copyright (c) .NET Foundation. All rights reserved. <_WasmProjectAssemblyBuild Include="@(WasmAssembliesFinal)" Condition="$(_WasmIntermediateAssemblyFileNames.Contains(';%(FileName)%(Extension);'))" /> <_WasmProjectAssemblyBuild Include="@(IntermediateAssembly)" Condition="@(_WasmProjectAssemblyBuild->Count()) == 0" /> <_WasmBuildAssetCandidates Include="@(ReferenceCopyLocalPaths)" /> - <_WasmBuildAssetCandidates Include="@(WasmNativeAsset)" /> + <_WasmBuildAssetCandidates Include="@(WasmNativeAsset)" WasmNativeBuildOutput="true" /> <_WasmBuildAssetCandidates Include="@(WasmAssembliesFinal)" /> <_WasmBuildAssetCandidates Remove="@(_WasmProjectAssemblyBuild)" /> @@ -357,12 +357,21 @@ Copyright (c) .NET Foundation. All rights reserved. + + + + <_WebcilAssetsCandidates Remove="@(_WasmFrameworkCandidates)" /> + + <_WebcilAssetsCandidates Update="@(_WebcilAssetsCandidates)" ContentRoot="%(RootDir)%(Directory)" /> + <_WasmFrameworkCandidates Update="@(_WasmFrameworkCandidates)" ContentRoot="%(RootDir)%(Directory)" /> <_WasmFingerprintPatterns Include="WasmFiles" Pattern="*.wasm" Expression="#[.{fingerprint}]!" /> <_WasmFingerprintPatterns Include="DllFiles" Pattern="*.dll" Expression="#[.{fingerprint}]!" /> <_WasmFingerprintPatterns Include="DatFiles" Pattern="*.dat" Expression="#[.{fingerprint}]!" /> @@ -370,6 +379,7 @@ Copyright (c) .NET Foundation. All rights reserved. <_WasmFingerprintPatterns Include="Symbols" Pattern="*.js.symbols" Expression="#[.{fingerprint}]!" /> + + + + + + + + + + + + + + <_WasmMaterializedFrameworkAssets Update="@(_WasmMaterializedFrameworkAssets)" AssetMode="All" /> + + + + /// Non-DLL files from shared locations (runtime pack, NuGet cache) that were not + /// converted to webcil. These are candidates for Framework SourceType materialization. + /// When IsEnabled is false, all candidates (DLL and non-DLL) appear here. + /// Items with WasmNativeBuildOutput metadata (per-project native build outputs) + /// are excluded — they're already unique per project. + /// + [Output] + public ITaskItem[] PassThroughCandidates { get; set; } + protected readonly List _fileWrites = new(); [Output] @@ -35,10 +45,15 @@ public class ConvertDllsToWebcil : Task public override bool Execute() { var webcilCandidates = new List(); + var passThroughCandidates = new List(); if (!IsEnabled) { + // When webcil is disabled, no conversion occurs. All candidates pass + // through unchanged. All are also pass-through candidates since none + // were converted to webcil. WebcilCandidates = Candidates; + PassThroughCandidates = Candidates; return true; } @@ -56,7 +71,19 @@ public override bool Execute() if (extension != ".dll") { + // Non-DLL files always appear in WebcilCandidates (backward compat + // for publish and other callers that only consume WebcilCandidates). webcilCandidates.Add(candidate); + + // Additionally classify shared framework files as pass-throughs. + // Items with WasmNativeBuildOutput metadata are per-project native + // build outputs (e.g. dotnet.native.wasm from obj/wasm/for-build/) + // that don't need Framework materialization. + bool isNativeBuildOutput = !string.IsNullOrEmpty(candidate.GetMetadata("WasmNativeBuildOutput")); + if (!isNativeBuildOutput) + { + passThroughCandidates.Add(candidate); + } continue; } @@ -75,6 +102,7 @@ public override bool Execute() Directory.Delete(tmpDir, true); WebcilCandidates = webcilCandidates.ToArray(); + PassThroughCandidates = passThroughCandidates.ToArray(); return true; }