Using Visual Studio 2017, I have a solution with many C# projects in it. I'm trying to find a way to set a conditional compilation symbol in one location such that all projects will have access to it.
Mainly, this is because our solution can be deployed to one of two instances. Depending on where it is being deployed, the code will need to access a different Database (the two databases are basically the same, but one is our production DB and the other is for testing so we don't break things unintentionally). I'd like it if a programmer can just set a flag in one place, and have all projects then be able to connect to the appropriate DB in-code. I was planning on doing this by using a #if TestDB ... #else ... #endif
when setting the connection strings.
I'd like to avoid using different Configurations (Release, Debug) due to some other flags that are already in use...
Any help would be appreciated!