When developing automation scripts, it is usual to add logging lines (either to the information console or the automation log) for troubleshooting purposes.
It could be great to conditionally add this logging based on the Compile in DEBUG mode setting:
Currently, I'm using a symbol definition (#define DEBUG) to include or exclude the logging. Is there a way to use the DEBUG mode setting instead?
To actually verify if the "Compile in using debug mode" is checked, you can use the following code:
var scriptInfo = engine.SendSLNetSingleResponseMessage(new GetScriptInfoMessage("your script name here")) as GetScriptInfoResponseMessage;
bool isDebug = scriptInfo.Exes[0].CSharpDebugMode;
note: This is an internal call and we do not recommend using this, as it is not officially supported and we cannot guarantee that it will still work in the future. As a rule, you should avoid using SLNet calls, as these are subject to change without notice.