syntax highlighting in visual studio 2019 for conditional compilation symbols for multi platform project with shared project not working

When I start the platform projects the conditionals are in fact working at runtime…

But would be nice to have syntax highlighting depending on which startup project is set inside the visual studio 2019 solution, this is not working for me at the moment.

Anybody has got an idea why this could happen?

Edit: I found out a little bit more… What I did was adding existing items (*.cs files) to the MonoGame Shared Project first. The platform project(s) already had references to the shared project added. Now when I need a new shared *.cs file I right click the shared project and click on add new item -> class… When I now try to add this new *.cs file created from the shared project by add existing item and add as link (important “add as link”! not normal “add” in visual studio!) I get an error saying that there is already a link to that file and I can only have one link to the same file. So I have to remove the file first by excluding it from the shared project. Then add the file as link to all platform projects. And then again add the file to the shared project where I am given only the option to add the file normally by visual studio. So… basically I want to know what the normal workflow is when adding a new class to a multi platform solution with conditional compilation symbols so that syntx highlighting works? Or is it not supposed to change highligting when I set another startup project? Only change it based on from which project it was openend? I thought I could have it the way that I only add new *.cs files to a shared project and it would all be fine. I mean the links are automatically added to the projects and everything compiles but syntax highlighting is not working that way which is not so nice at least… Any ideas? Maybe I am doing it all wrong :slight_smile:

Edit2: I think Visual Studio 2019 has a bug in Syntax highlighting when using a Shared Project. I mean I could be wrong but I think only having to add code to a shared project (and not link everything everywhere in all projects) is the way it is supposed to work with a solution containing a shared project. I mean most of the code will not be inside compiler directives using conditional compilation symbols anyway.