如何根据部署配置文件有条件地编译 类?

How to conditionally compile classes based on deployment profile?

there is a code command available to conditionally compile the code. .Net Directive Example.

or 中是否有等效方法来实现相同的方法?

我不认为编译器中默认包含一个,但也许 the preprocessor capabilities of Manifold 对您的情况有所帮助。它支持通常的 #define#undef#if 在 C 及其表兄弟中可用。