Can I use preprocessor directives (e.g. UNITY_5) in a managed plugin?

I’m building a managed unity plugin and want to use platform defines such as UNITY_5.
Is it possible? Is yes, how?

Yes, but you need to manage them yourself. In Visual Studio, you can define preprocessor directives (called “Conditional compilation symbols”) in the Project Settings window, under the Build Tab.

But, like I said, you have to manage them manually. They won’t pick up changes from the unity environment if they’re built outside that environment.