diff --git a/src/mono/wasi/build/WasiApp.InTree.props b/src/mono/wasi/build/WasiApp.InTree.props
index 894b17f646e38..b85fd737856dc 100644
--- a/src/mono/wasi/build/WasiApp.InTree.props
+++ b/src/mono/wasi/build/WasiApp.InTree.props
@@ -11,12 +11,4 @@
partial
false
-
-
- <_MonoRuntimeComponentDontLink Include="libmono-component-debugger-stub-static.a" />
-
- <_MonoRuntimeComponentDontLink Include="libmono-component-diagnostics_tracing-static.a" Condition="'$(FeatureWasmPerfTracing)' != 'true' and $(FeatureWasmManagedThreads) != 'true'"/>
- <_MonoRuntimeComponentDontLink Include="libmono-component-hot_reload-stub-static.a" />
- <_MonoRuntimeComponentDontLink Include="libmono-component-marshal-ilgen-stub-static.a" />
-
diff --git a/src/mono/wasi/build/WasiApp.targets b/src/mono/wasi/build/WasiApp.targets
index b229d76dd71ff..37d6d40d1f172 100644
--- a/src/mono/wasi/build/WasiApp.targets
+++ b/src/mono/wasi/build/WasiApp.targets
@@ -23,6 +23,16 @@
_WasmGenerateNodeScripts;
+
+ $(WasiWriteRspForLinkingDependsOn);
+ _WasmSelectRuntimeComponentsForLinking;
+ _WasiGetWasiOutputFileName;
+
+
+ $(WasiWriteRspForLinkingDependsOn);
+ _MonoSelectRuntimeComponents;
+
+
true
@@ -261,7 +271,7 @@
@@ -296,12 +306,15 @@
<_WasmSIMDLibToExclude Condition="'$(WasmEnableSIMD)' == 'true'">libmono-wasm-nosimd.a
+
+ <_MonoRuntimeComponentDontLink Include="wasm-bundled-timezones.a" Condition="'$(InvariantTimezone)' == 'true'"/>
+ <_MonoRuntimeComponentDontLink Include="libmono-component-diagnostics_tracing-static.a" Condition="'$(UsingWasiRuntimeWorkload)' != 'true'" />
+
+
<_WasmNativeFileForLinking Include="%(_BitcodeFile.ObjectFile)" />
- <_MonoRuntimeComponentDontLink Include="libmono-component-diagnostics_tracing-static.a" />
- <_MonoRuntimeComponentDontLink Include="wasm-bundled-timezones.a" Condition="'$(InvariantTimezone)' == 'true'"/>
<_WasmNativeFileForLinking
Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)*.a"
@@ -440,4 +453,4 @@ wasi.start(instance);
-
+
\ No newline at end of file
diff --git a/src/mono/wasm/build/WasmApp.Common.targets b/src/mono/wasm/build/WasmApp.Common.targets
index 5c7e4353fee0a..7e4c7d343417f 100644
--- a/src/mono/wasm/build/WasmApp.Common.targets
+++ b/src/mono/wasm/build/WasmApp.Common.targets
@@ -251,9 +251,16 @@
-
-
- <_MonoComponent Include="hot_reload;debugger" />
+
+
+ <_WasmDebuggerSupport Condition="'$(WasmDebugLevel)' != '' and '$(WasmDebugLevel)' != '0'">true
+ <_WasmDebuggerSupport Condition="'$(WasmDebugLevel)' != '' and '$(WasmDebugLevel)' == '0'">false
+ <_WasmDebuggerSupport Condition="'$(_WasmDebuggerSupport)' == '' and '$(WasmBuildingForNestedPublish)' == 'true'">false
+ <_WasmDebuggerSupport Condition="'$(_WasmDebuggerSupport)' == ''">true
+
+
+ <_MonoComponent Include="debugger" />
+ <_MonoComponent Include="hot_reload" />
@@ -590,7 +597,7 @@
-
+
<_AssembliesToScan Include="@(_WasmAssembliesInternal)" />