Why can't you have preprocessor directives in csx files? #49200
Unanswered
ByronMayne
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question
Currently you can't define custom preprocessor directives in a csx file using csi, a response file or by running it in code with the CommandLineParser. My question is why is this not exposed?
As a test I tried setting the value with reflection and it worked fine. My only assumption would be the reason it's turned off would be due to the fact that it might breaking the internal caching logic.
Why would I even need this?
I am working on tooling that expose csx scripting to our teams as plugins. I want them to have auto complete in VSCode. Unfortunately since there is no way to define the global object statically to omni sharp my option was to create .csx files which will only be compiled when running inside omnisharp.
#if OMNI_SHARP
// Example global property
string PackageName { get; set; }
#endif
Beta Was this translation helpful? Give feedback.
All reactions