I doubth this is correct.
To get a build variable you need the project the configuration (RELEASE, DEBUG) and the variable name.
In this code the variable name gets replaced by an empty string.
The method also calls itself. I understand this as going into an endless loop