Just had a funny encounter with Visual studio graying-out everything inside my #if UNITY_EDITOR defines.
Turns out Visual studio must be in Debug mode, not in Release mode, because macros only work for the Debug mode.
Original source:
http://answers.unity.com/answers/668092/view.html
Just found this out from Developer Community
8 Likes
Omg, thank you so much! That helps.
Thanks for the tip!
Also if you don’t see it, there is a chance the Assembly-Csharp reference project was unloaded.

in which case just RIGHT click and reload it.

1 Like
I know that Visual Studio does not generate a csproj file for package assemblies. I had a similar issue with a module package I was using that was installed from Git that used UNITY_EDITOR defines. Going to Edit > Preferences > Generate csproj files for: git packages and then regenerating the project files seemed to fix the code being greyed out in VS.

Your solution was the one i needed, I have no idea why but my Assembly was not loaded on my project