Skip to content

Commit 85de952

Browse files
authored
[release/8.0] [browser] Fix processing of satellite assemblies from referenced assembly during publish (#109920)
* Enable satellite discovery in nested build and include them in WasmAssembliesFinal * Fix RawFileName for satellites from References
1 parent 2eb7dd0 commit 85de952

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/mono/wasm/build/WasmApp.targets

+2-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
207207
<!-- Use a unique property, so the already run wasm targets can also run -->
208208
<MSBuild Projects="$(MSBuildProjectFile)"
209209
Targets="WasmNestedPublishApp"
210-
Properties="_WasmInNestedPublish_UniqueProperty_XYZ=true;;WasmBuildingForNestedPublish=true;DeployOnBuild=;_IsPublishing=;_WasmIsPublishing=$(_IsPublishing)">
210+
Properties="_WasmInNestedPublish_UniqueProperty_XYZ=true;;WasmBuildingForNestedPublish=true;DeployOnBuild=;_IsPublishing=;_WasmIsPublishing=$(_IsPublishing);ResolveAssemblyReferencesFindRelatedSatellites=true">
211211
<Output TaskParameter="TargetOutputs" ItemName="WasmNestedPublishAppResultItems" />
212212
</MSBuild>
213213

@@ -503,6 +503,7 @@
503503
<Target Name="_AfterWasmBuildApp">
504504
<ItemGroup>
505505
<WasmAssembliesFinal Include="@(_WasmAssembliesInternal)" LlvmBitCodeFile="" />
506+
<WasmAssembliesFinal Include="@(_WasmSatelliteAssemblies)" />
506507
</ItemGroup>
507508
</Target>
508509
</Project>

src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/ComputeWasmBuildAssets.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,12 @@ public override bool Execute()
111111
assetCandidate.SetMetadata("AssetTraitName", "Culture");
112112
assetCandidate.SetMetadata("AssetTraitValue", inferredCulture);
113113
assetCandidate.SetMetadata("RelativePath", $"_framework/{inferredCulture}/{satelliteAssembly.GetMetadata("FileName")}{satelliteAssembly.GetMetadata("Extension")}");
114-
assetCandidate.SetMetadata("RelatedAsset", Path.GetFullPath(Path.Combine(OutputPath, "wwwroot", "_framework", Path.GetFileName(assetCandidate.GetMetadata("ResolvedFrom")))));
114+
115+
var resolvedFrom = assetCandidate.GetMetadata("ResolvedFrom");
116+
if (resolvedFrom == "{RawFileName}") // Satellite assembly found from `<Reference />` element
117+
resolvedFrom = candidate.GetMetadata("OriginalItemSpec");
118+
119+
assetCandidate.SetMetadata("RelatedAsset", Path.GetFullPath(Path.Combine(OutputPath, "wwwroot", "_framework", Path.GetFileName(resolvedFrom))));
115120

116121
assetCandidates.Add(assetCandidate);
117122
continue;

0 commit comments

Comments
 (0)