TestValue will still be 0 even the project exported.
I’ve closed debug symbles and set debug/export_console_wrapper to false in Windows export config but useless. I’ve also set C# project property config to ExportRelease which excludes DEBUG constant but useless, too.
Is there any way to use #if DEBUG properly in Godot mono?
In the very last window of the export process (the one where you choose where you want to save the exported files), there is a checkbox above the Save and Cancel buttons. That’s where you can switch between exporting a debug and a release build. Unchecking it will give you a build with DEBUG undefined. The other options you mentioned aren’t useless, they control other things. Export Console Wrapper conditions the export of the additional .console.exe file, and Include Debug Symbols conditions the inclusion of actual debug symbols in the produced files.
Cool, it works. I didn’t expect to switch debug and release build here, especially “With Debug” makes me a misunderstanding of a release build with some debug symbols. I prefer they move this switch into export settings config.
Thanks for reply. Preprocessor is convenient when class property definition meats different condition. OS.IsDebugBuild() seems more likely to use in function body other than class property definition.