Okay, here is a good one. I'm trying to open a serial port in a (Avalonia) window's constructor. The issue is that the (Rider) IDE creates the GUI in the editor and opens the serial port. Then when the application runs it cannot open the serial port because its open in the editor. If I build and run the program outside of the IDE it works fine. My question is if there is a preprocessor directive to directive if the GUI is being rendered in the IDE and if so how to use it.