diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets
index 44b256bf2f726..8a8307f406c5c 100644
--- a/src/mono/wasm/build/WasmApp.targets
+++ b/src/mono/wasm/build/WasmApp.targets
@@ -464,18 +464,17 @@
+
+ <_EmccIncludePaths Include="$(_WasmIntermediateOutputPath.TrimEnd('\/'))" />
+ <_EmccIncludePaths Include="$(_WasmIncludeDir)mono-2.0" />
+ <_EmccIncludePaths Include="$(_WasmIncludeDir)wasm" />
+
+
- $(EmccFlags) -DCORE_BINDINGS -DGEN_PINVOKE=1 "-I$(_WasmIncludeDir)mono-2.0" "-I$(_WasmIncludeDir)wasm"
+ $(EmccFlags) -DCORE_BINDINGS -DGEN_PINVOKE=1
+ $(EmccCFlags) @(_EmccIncludePaths -> '"-I%(Identity)"', ' ')
$(EmccCFlags) -g
-
- $(EmccCFlags) "-I$(_WasmIntermediateOutputPath)."
- $(EmccCFlags) "-I$(_WasmIntermediateOutputPath)"
-
$(EmccFlags) -s TOTAL_MEMORY=536870912
<_WasmOptCommand>$([MSBuild]::NormalizePath('$(EmSdkUpstreamBinPath)', 'wasm-opt$(_ExeExt)'))