Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish Failure in .NET 9 RC 2 for Blazor Web App (.NET 8, Auto Render Mode) and Blazor WASM (.NET 8) with Localization #109604

Closed
BharatRamH opened this issue Nov 7, 2024 · 8 comments
Assignees
Labels
arch-wasm WebAssembly architecture area-Build-mono os-browser Browser variant of arch-wasm
Milestone

Comments

@BharatRamH
Copy link

BharatRamH commented Nov 7, 2024

Description

Publishing a Blazor Web App (targeting .NET 8, with Auto Render mode) and a Blazor WASM app (targeting .NET 8), both utilizing the localization feature, fails in .NET 9 RC 2.

Reproduction Steps

  1. Create a Blazor Web App targeting .NET 8 with Auto Render mode.
  2. Set up the dynamic localization feature.
  3. Attempt to publish the app.

An error occurs during publishing with the message: "Can't find the original satellite assembly in the list of resolved files to publish for asset," as shown in the screenshot below.

Image

Sample.zip

Environment:
.NET SDK version: 9.0.100-rc.2.24474.11

Expected behavior

The application should publish successfully with all necessary localization files.

Actual behavior

Publishing fails due to a missing satellite assembly file.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Nov 7, 2024
@maraf maraf added arch-wasm WebAssembly architecture area-Build-mono os-browser Browser variant of arch-wasm and removed area-VM-meta-mono labels Nov 7, 2024
@maraf maraf self-assigned this Nov 7, 2024
@maraf maraf added this to the 9.0.x milestone Nov 7, 2024
Copy link
Contributor

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

@dotnet-policy-service dotnet-policy-service bot removed the untriaged New issue has not been triaged by the area owner label Nov 7, 2024
@maraf maraf removed the untriaged New issue has not been triaged by the area owner label Nov 7, 2024
@maraf
Copy link
Member

maraf commented Nov 7, 2024

Findings: Workload in .NET 8 doesn't include satellites in WasmAssembliesFinal
https://github.com/dotnet/runtime/blob/main/src/mono/wasm/build/WasmApp.Common.targets#L486
vs
https://github.com/dotnet/runtime/blob/release/8.0/src/mono/wasm/build/WasmApp.targets#L505

WasmApp.targets

  <Target Name="WasmTriggerPublishApp"
          AfterTargets="$(WasmTriggerPublishAppAfterThisTarget)"
          Condition="'$(IsBrowserWasmProject)' == 'true' and '$(WasmBuildingForNestedPublish)' != 'true' and '$(IsCrossTargetingBuild)' != 'true'">

    <!-- Use a unique property, so the already run wasm targets can also run -->
    <MSBuild Projects="$(MSBuildProjectFile)"
             Targets="WasmNestedPublishApp"
-             Properties="_WasmInNestedPublish_UniqueProperty_XYZ=true;;WasmBuildingForNestedPublish=true;DeployOnBuild=;_IsPublishing=;_WasmIsPublishing=$(_IsPublishing)">
+             Properties="_WasmInNestedPublish_UniqueProperty_XYZ=true;;WasmBuildingForNestedPublish=true;DeployOnBuild=;_IsPublishing=;_WasmIsPublishing=$(_IsPublishing);ResolveAssemblyReferencesFindRelatedSatellites=true">
      <Output TaskParameter="TargetOutputs" ItemName="WasmNestedPublishAppResultItems" />
    </MSBuild>

    <ItemGroup>
      <WasmAssembliesFinal Remove="@(WasmAssembliesFinal)" />
      <WasmAssembliesFinal Include="@(WasmNestedPublishAppResultItems)" Condition="'%(WasmNestedPublishAppResultItems.OriginalItemName)' == 'WasmAssembliesFinal'" />

      <WasmNativeAsset Remove="@(WasmNativeAsset)" />
      <WasmNativeAsset Include="@(WasmNestedPublishAppResultItems)" Condition="'%(WasmNestedPublishAppResultItems.OriginalItemName)' == 'WasmNativeAsset'" />

      <FileWrites Include="@(WasmNestedPublishAppResultItems)" Condition="'%(WasmNestedPublishAppResultItems.OriginalItemName)' == 'FileWrites'" />
    </ItemGroup>
  </Target>

....

  <Target Name="_AfterWasmBuildApp">
    <ItemGroup>
      <WasmAssembliesFinal Include="@(_WasmAssembliesInternal)" LlvmBitCodeFile="" />
+      <WasmAssembliesFinal Include="@(_WasmSatelliteAssemblies)" />
    </ItemGroup>
  </Target>

@maraf maraf modified the milestones: 9.0.x, 8.0.x Nov 7, 2024
@Hona
Copy link
Contributor

Hona commented Nov 18, 2024

We're getting this error building our .net 8 blazor wasm project using the .net 9 sdk.
Also it seems dotnet run vs dotnet watch produce different behaviours here

@williambuchanan2
Copy link

Anyone know of any workarounds for this? It's happening on our Azure Pipeline builds.

@maraf
Copy link
Member

maraf commented Nov 18, 2024

The workaround for now is to use .NET 8 SDK

  1. Check what .NET SDKs are installed by running dotnet --list-sdks
PS> dotnet --list-sdks
6.0.321 [C:\Program Files\dotnet\sdk]
6.0.428 [C:\Program Files\dotnet\sdk]
7.0.120 [C:\Program Files\dotnet\sdk]
8.0.404 [C:\Program Files\dotnet\sdk]
9.0.100 [C:\Program Files\dotnet\sdk]
  1. Choose the latest .NET 8. If you don't have .NET 8 SDK (it can happen), install it from https://dotnet.microsoft.com/en-us/download/dotnet/8.0
  2. Pin the SDK using global.json
PS> dotnet new globaljson --sdk-version 8.0.404

The global.json will look like

{
  "sdk": {
    "version": "8.0.404"
  }
}

@williambuchanan2
Copy link

The workaround now is to use .NET 8 SDK, for example by pinning it in global.json dotnet new globaljson --sdk-version 8.0.404

Thanks for the info. This partly worked. It looks like the SDK is also not available now so had to install that as well.

@LoupaLoupa
Copy link

I am also having this issue on pipelines that builds AOT builds. What is the current official workaround in pipelines and what is ETA on fix to Azure pipelines please?

@maraf
Copy link
Member

maraf commented Dec 3, 2024

Fixed in #109920. It will be released in the next servicing release.

@maraf maraf closed this as completed Dec 3, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jan 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Build-mono os-browser Browser variant of arch-wasm
Projects
None yet
Development

No branches or pull requests

5 participants