File tree Expand file tree Collapse file tree 4 files changed +25
-0
lines changed Expand file tree Collapse file tree 4 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 207207 </ItemGroup >
208208
209209 <WriteLinesToFile File =" $(WasmMainHtmlPath)" Lines =" < html>< body>< script type='module' src='$(WasmMainJSFileName)'>< /script>< /body>< /html> " Overwrite =" True" Condition =" !Exists('$(WasmMainHtmlPath)')" />
210+
211+ <ForceMSBuildGC />
210212 </Target >
211213
212214 <Target Name =" _PrepareForAOTOnHelix" >
Original file line number Diff line number Diff line change 129129 TargetPath =" %(WasmFilesToIncludeFromPublishDir.Identity)"
130130 Condition =" '%(WasmFilesToIncludeFromPublishDir.Identity)' != ''" />
131131 </ItemGroup >
132+
133+ <ForceMSBuildGC />
132134 </Target >
133135
134136 <Target Name =" _PrepareForAOTOnHelix" >
Original file line number Diff line number Diff line change 9393 TaskName =" Microsoft.WebAssembly.Build.Tasks.GenerateAOTProps"
9494 AssemblyFile =" $(WasmBuildTasksAssemblyPath)" TaskFactory =" TaskHostFactory" />
9595
96+ <UsingTask TaskName =" Microsoft.WebAssembly.Build.Tasks.ForceMSBuildGC" AssemblyFile =" $(WasmBuildTasksAssemblyPath)" />
97+
9698 <Target Name =" _BundleAOTTestWasmAppForHelix" DependsOnTargets =" $(_BundleAOTTestWasmAppForHelixDependsOn)" >
9799 <PropertyGroup >
98100 <_MainAssemblyPath Condition =" '%(WasmAssembliesToBundle.FileName)' == $(AssemblyName) and '%(WasmAssembliesToBundle.Extension)' == '.dll'" >%(WasmAssembliesToBundle.Identity)</_MainAssemblyPath >
Original file line number Diff line number Diff line change 1+ // Licensed to the .NET Foundation under one or more agreements.
2+ // The .NET Foundation licenses this file to you under the MIT license.
3+
4+ using System ;
5+ using Microsoft . Build . Framework ;
6+ using Microsoft . Build . Utilities ;
7+
8+ namespace Microsoft . WebAssembly . Build . Tasks
9+ {
10+ public class ForceMSBuildGC : Task
11+ {
12+ public override bool Execute ( )
13+ {
14+ GC . Collect ( ) ;
15+ GC . WaitForPendingFinalizers ( ) ;
16+ return true ;
17+ }
18+ }
19+ }
You can’t perform that action at this time.
0 commit comments