Skip to content

Commit 2fefdb3

Browse files
authored
Fix WasmAssembliesToBundle item is empty error (#1742)
Context: dotnet/runtime#56033 The standalone (aka non-blazor) projects have to set `WasmAssembliesToBundle` item themselves. (for now, it might be easier in future)
1 parent 081563a commit 2fefdb3

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

src/BenchmarkDotNet/Templates/WasmAotCsProj.txt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,20 @@
2222
<Import Project="$(RuntimeSrcDir)/src/mono/wasm/build/WasmApp.LocalBuild.props" />
2323
<Import Project="$(RuntimeSrcDir)/src/mono/wasm/build/WasmApp.LocalBuild.targets" />
2424

25-
26-
<ItemGroup>
27-
<WasmAssembliesToBundle Include="$(AppDir)/*.dll" />
28-
</ItemGroup>
29-
30-
3125
<ItemGroup>
3226
<Compile Include="$CODEFILENAME$" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
3327
</ItemGroup>
3428

3529
<ItemGroup>
3630
<ProjectReference Include="$CSPROJPATH$" />
3731
</ItemGroup>
32+
33+
<PropertyGroup>
34+
<WasmBuildAppDependsOn>PrepareForWasmBuild;$(WasmBuildAppDependsOn)</WasmBuildAppDependsOn>
35+
</PropertyGroup>
36+
<Target Name="PrepareForWasmBuild">
37+
<ItemGroup>
38+
<WasmAssembliesToBundle Include="$(TargetDir)publish\*.dll" />
39+
</ItemGroup>
40+
</Target>
3841
</Project>

src/BenchmarkDotNet/Templates/WasmCsProj.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,13 @@
3232
<ItemGroup>
3333
<ProjectReference Include="$CSPROJPATH$" />
3434
</ItemGroup>
35+
36+
<PropertyGroup>
37+
<WasmBuildAppDependsOn>PrepareForWasmBuild;$(WasmBuildAppDependsOn)</WasmBuildAppDependsOn>
38+
</PropertyGroup>
39+
<Target Name="PrepareForWasmBuild">
40+
<ItemGroup>
41+
<WasmAssembliesToBundle Include="$(TargetDir)publish\*.dll" />
42+
</ItemGroup>
43+
</Target>
3544
</Project>

0 commit comments

Comments
 (0)