diff --git a/src/mono/mono.proj b/src/mono/mono.proj
index cd15d2c320da6..53794fd2397be 100644
--- a/src/mono/mono.proj
+++ b/src/mono/mono.proj
@@ -468,6 +468,7 @@
$(EMSDK_PATH)/upstream/lib/libclang.so
$([MSBuild]::NormalizePath('$(EMSDK_PATH)', 'upstream', 'bin', 'libclang.dll'))
call "$([MSBuild]::NormalizePath('$(EMSDK_PATH)', 'emsdk_env.bat'))" && python
+ <_ForceRelease Condition="$([MSBuild]::IsOSPlatform('Windows')) and '$(TargetArchitecture)' == 'wasm' and '$(Configuration)' == 'Debug'">true
@@ -478,8 +479,8 @@
<_MonoAOTCPPFLAGS Include="-DWIN32_LEAN_AND_MEAN" />
<_MonoAOTCPPFLAGS Condition="'$(Platform)' == 'x64' or '$(Platform)' == 'arm64'" Include="-DWIN64" />
- <_MonoAOTCPPFLAGS Condition="'$(Configuration)' == 'Release'" Include="-DNDEBUG" />
- <_MonoAOTCPPFLAGS Condition="'$(Configuration)' == 'Debug'" Include="-D_DEBUG" />
+ <_MonoAOTCPPFLAGS Condition="'$(Configuration)' == 'Release' or '$(_ForceRelease)' == 'true'" Include="-DNDEBUG" />
+ <_MonoAOTCPPFLAGS Condition="'$(Configuration)' == 'Debug' and '$(_ForceRelease)' != 'true'" Include="-D_DEBUG" />
<_MonoAOTCPPFLAGS Include="-D_CRT_SECURE_NO_WARNINGS" />
<_MonoAOTCPPFLAGS Include="-D_CRT_NONSTDC_NO_DEPRECATE" />
@@ -539,7 +540,8 @@
-
+
+