I’m trying to get the appropriate #define directives defined in VS2019 while I’m working on my project. I’ve tried two things:
Checking the Build Settings->Server Build checkbox. If I check that in the Unity Editor, then open a script by double clicking it in Unity, it opens VS2019 and takes me to the script, but UNITY_SERVER is not defined in the VS2019 editor. Note that pushing the Build button from Unity defines UNITY_SERVER correctly, but I’m trying to get it defined while I’m working on the project.
Adding a preprocessor directive in Unity Project Settings->Player->Scripting Define Symbols also does not work. Again, the symbols are defined when I push the Build button from Unity, but are not defined when I double click a script file and open it in VS2019.
I checked that I have the correct platform selected. I also checked the project file in VS2019 and verified that the above preprocessor directives are definitely not listed.
Is this a limitation of the editing environment or am I doing something wrong?
The “Regenerate C# Project” worked to get the Scripting Define Symbols directives defined. I still can’t get Unity to pass UNITY_SERVER when I check the Build Server checkbox, but that one is less troublesome because I can define it manually.
Thanks for the links!