I have a website project I inherited and am attempting to clean up. It had a Common.cs file with over 10,000 loc so I have since separated it out into different files. The problem is that at the top of the Common file is a #define UAT
statement that is used throughout the code to make certain configuration decisions such as :
#if UAT
using WCFServiceUAT;
#else
using WCFServicePRD;
#endif
So now, when I go to deploy the production version of this application, I will have to remove the #define statement in many different places, which seems error prone and a generally bad idea. I am looking for something such as Conditional Compilation Constants where I can define this once, and have it affect the entire project.
This type of configuration control is only being used in C# files. the #define statement used to only need to be changed in Default.aspx.cs and Common.cs, but since my restructuring efforts, it now appears a lot more. Though it would be nice for my site.master file to change the header based off of some configuration, it is much less of a concern.
I have attempted to alter the build configuration properties for the project but do not have any options such as conditional compilation constants and am assuming that it is not supported for my type of project. Is there any other way to put a #define on a global project level, instead of at the top of every file? The only solution I have found is for a Web application project, and based on Web Application Projects Vs Web Site Projects, I do not believe I am working with a web application type project because there is no .csproj file.