The IDEs cannot recognize the UNITY_EDITOR scripting define symbol in the xxx.Player assembly

I have noticed that there are always two types of runtime assemblies generated by Unity, one of which has the suffix .Player. However, the IDE cannot recognize the UNITY_EDITOR symbol in the assembly with the .Player suffix.

For example, Visual Studio can recognize the UNITY_EDITOR symbol in Assembly-CSharp, but cannot recognize the UNITY_EDITOR symbol in Assembly-CSharp.Player (the code is displayed in gray):


This issue is particularly severe for Rider. Because Rider displays the Unity resource structure by default instead of the Solution resource structure, the code wrapped in the UNITY_EDITOR symbol is always gray:

In Rider there is a context switch in the bottom of the text control, which allows you to switch between Player and non-Player csproj, when some file exists in both of them.

1 Like

This is very helpful, thank you!

Has Rider considered setting the non-Player csproj as the default context? After all, in development, most of the time we need to focus on those editor code.

1 Like

I can’t say immediately. Would require some investigation. Would you mind raising a request on https://youtrack.jetbrains.com/issues/RIDER?