From 34f7bad53a929abcc6fe9a42188ea6e3d081361c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Mon, 18 Nov 2024 14:16:41 +0100 Subject: [PATCH 1/2] Enable satellite discovery in nested build and include them in WasmAssembliesFinal --- src/mono/wasm/build/WasmApp.targets | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets index bc92659fa3479b..814acbdf5bae28 100644 --- a/src/mono/wasm/build/WasmApp.targets +++ b/src/mono/wasm/build/WasmApp.targets @@ -207,7 +207,7 @@ + Properties="_WasmInNestedPublish_UniqueProperty_XYZ=true;;WasmBuildingForNestedPublish=true;DeployOnBuild=;_IsPublishing=;_WasmIsPublishing=$(_IsPublishing);ResolveAssemblyReferencesFindRelatedSatellites=true"> @@ -503,6 +503,7 @@ + From db93f0e5c5d2f3f5abfdf311d606210942e17b51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Mon, 18 Nov 2024 14:18:53 +0100 Subject: [PATCH 2/2] Fix RawFileName for satellites from References --- .../ComputeWasmBuildAssets.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/ComputeWasmBuildAssets.cs b/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/ComputeWasmBuildAssets.cs index f2e4336da3630b..20f80f15680cfe 100644 --- a/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/ComputeWasmBuildAssets.cs +++ b/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/ComputeWasmBuildAssets.cs @@ -111,7 +111,12 @@ public override bool Execute() assetCandidate.SetMetadata("AssetTraitName", "Culture"); assetCandidate.SetMetadata("AssetTraitValue", inferredCulture); assetCandidate.SetMetadata("RelativePath", $"_framework/{inferredCulture}/{satelliteAssembly.GetMetadata("FileName")}{satelliteAssembly.GetMetadata("Extension")}"); - assetCandidate.SetMetadata("RelatedAsset", Path.GetFullPath(Path.Combine(OutputPath, "wwwroot", "_framework", Path.GetFileName(assetCandidate.GetMetadata("ResolvedFrom"))))); + + var resolvedFrom = assetCandidate.GetMetadata("ResolvedFrom"); + if (resolvedFrom == "{RawFileName}") // Satellite assembly found from `` element + resolvedFrom = candidate.GetMetadata("OriginalItemSpec"); + + assetCandidate.SetMetadata("RelatedAsset", Path.GetFullPath(Path.Combine(OutputPath, "wwwroot", "_framework", Path.GetFileName(resolvedFrom)))); assetCandidates.Add(assetCandidate); continue;