Skip to content

Commit

Permalink
[wasm] Fix regression in blazor+aot
Browse files Browse the repository at this point in the history
- For blazor AOT, the blazor targets explicitly skip
  `Microsoft.JSInterop.WebAssembly.dll` in `_GatherBlazorFilesToPublish` target.
  - it is done by marking the assembly item in
    `@(WasmAssembliesToBundle)` with `%(AOT_InternalForceToInterpret)="true"`.

- this target needs to run after `_GatherWasmFilesToPublish` which builds
  the list of assemblies to AOT in `@(WasmAssembliesToBundle)`

- the order of these two targets was corrected in #31640
- but the changes in #31559 added the
  target twice, resulting in the order:

  `_GatherBlazorFilesToPublish;_GatherWasmFilesToPublish;_GatherBlazorFilesToPublish`

  1. in which the first `_GatherBlazorFilesToPublish` tries to remove
     the assembly from an empty list
  2. then `_GatherWasmFilesToPublish` populates the list
  3. and the last instance of `_GatherBlazorFilesToPublish` target
     doesn't run because it has already run before in (2).
- thus the assembly never gets removed from the list.

Fixes: dotnet/runtime#85010
  • Loading branch information
radical committed Apr 18, 2023
1 parent 4ea3e83 commit 9d32226
Showing 1 changed file with 0 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ Copyright (c) .NET Foundation. All rights reserved.

<DisableAutoWasmBuildApp>true</DisableAutoWasmBuildApp>
<DisableAutoWasmPublishApp>true</DisableAutoWasmPublishApp>
<WasmNestedPublishAppDependsOn>_GatherBlazorFilesToPublish;$(WasmNestedPublishAppDependsOn)</WasmNestedPublishAppDependsOn>
</PropertyGroup>

<!-- Wire-up static web assets -->
Expand Down

0 comments on commit 9d32226

Please sign in to comment.