Is there any compile-time flag in C# that makes it possible to conditionally specify runtime requirements? For example, considering the flag #if DEBUG ... #endif
, is it possible to do something similar to:
#if RUNTIME_LINUX_X64
// Read file X
#endif
#if RUNTIME_WIN_X64
// Read file y
#endif
So that, the correct portion of the code would be compiled based on the -r
flag associated with the publish
command.
Update: I don't want to use #define xxx
and I want to get the target runtime value based on the -r
flag only.