此代码在升级到 mono 5.0 后损坏:
#if __MonoCS__ //Linux...
var mode = LZ4StreamMode.Compress;
#else //Windows...
var mode = System.IO.Compression.CompressionMode.Compress;
#endif
我可以用什么常量来代替?
最佳答案
this is noted in the release notes for mono 5.0以及推理:
Note: mcs defined the MonoCS symbol and some users incorrectly used it to conditionally compile code specific to Mono. This is considered bad practice and won’t work anymore now that csc is the default compiler. You can detect whether you’re running on Mono at runtime instead.
关于c# - __MonoCS__ 在单声道 5.0 中不起作用。如何在编译时确定平台?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43984301/