Hi.
I want to use preprocessor instruction "#define DEBUG" as first instruction on a C# automation script
But when I clic validate, I've got one error: "Cannot define/undefine preprocessor symbols after token in file".
I don't understand what is the problem. What is the token, it's talking about?
Better how could I resolve it without running allways instructions like I've seen in others questions on DOJO.
Thanks
See: Adding C# code to an Automation script | DataMiner Docs
If you don't define a Script class, dataminer will make that class for you and wrap your code in it.
#define is not allowed to be in a class in C# so it will give that error.
So if you want to work with defines you should write your own script class and run your code in the Run method.
Hi Henri,
You must make sure the #define DEBUG is the very first line of code in your script.
e.g. the code below validates just fine:
Would you be able to share a screenshot of your automation script (or a link to a Git repo)?
The “#define DEBUG” is on top of script, on first line.
The error message is always here.