How to set different global variable values for release and debug mode C#

c#, release, visual-studio

Solution

You can use preprocessors directives for different debug/release values.

#if DEBUG
   public const string RootUrl = "http://url/";
#else
   public const string RootUrl = "http://another/";
#endif

Problem

I'm developing an ASP.NET MVC web application using C#. I have a set a global variables, for example: ``` public static class Global { public const string RootUrl = "http://url/"; } ``` I want to set them with different values for release and debug mode. Could anyone give a suggestion on how to do this?

Original source