Is it possible to differentiate between operating systems in C#
using preprocessor
? like :
#if OS_WINDOWS
//windows methods
#elif O
What you are asking for is possible but needs a bit of work.
Define a preprocessor variable in your csproj
_WINDOWS
Use that in your code
#if _WINDOWS
// your windows stuff
#else
// your *nix stuff
#endif
I find this technique useful when you have constants that are dependent on the OS (for example native library names)