I know I can check if a preprocessor directive is defined using the #if syntax.
But I want to get a list of defined preprocessor directives to pass it over to a realtime compiling using CSharpCodeProvider
Thanks for advance.
I don't think that is possible. Related.
The compiler itself doesn't know about preprocessor. It receives already preprocessed code so there is no reason to remember what directives were defined.