Possible Duplicate:
#if Not Debug in c#?
I am not have the permission to upload to the server so I am not able to test the #else part.
I was wondering if this is the ideal way to have conditionally choose what drive letter to use
depending on if in DEBUG (test mode) or in Production mode (#else part)
#if (DEBUG)
string driveLetter = "C:\\";
#else
string driveLetter = ConfigurationManager.AppSettings["ProdDrive"];
#endif
Extending the answer from @Mike.Beeler I strongly suggest that you use Slow Cheetah for this. Slow Cheetah provides XML transforms to any XML (including .config) file for your project based on the current build configuration.
The most common use is to automatically set the correct DB connection string, but you can also use it to set an app setting.
It is a free VS extension from a Microsoft employee
http://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5