I have a View in which I want to conditionally display code from one of two files:
<%
if (System.Diagnostics.Debugger.IsAttached) {
Response.WriteFile("~/path/to/index-A.html");
} else {
Response.WriteFile("~/path/to/index-B.html");
}
%>
The above code works... but I'm actually less interested if the debugger is attached. Rather, I want to know whether the developer has selected "Debug" or "Production" from the Configuration Manager drop-down in the Visual Studio 2012 "Standard" toolbar.
Why? I have a Pre-build step which conditionally compiles some JavaScript and CSS based upon the "ConfigurationName".
I was trying to use something like this:
if (System.Configuration.ConfigurationManager == "Debug") { //...
...but that doesn't work (for a variety of reasons) and my C#/ASP.NET knowledge simply lacks in this area.
Help?