<p>So I have about 10 short css files that I use with mvc app.
There are like
error.css
login.css
etc...
Just some really short css files that make updating and editing easy (At least for me). What I want is something that will optimize the if else branch and not incorporate it within the final bits. I want to do something like this</p>

<pre><code>if(Debug.Mode){

&lt;link rel="stylesheet" type="text/css" href="error.css" /&gt; 
&lt;link rel="stylesheet" type="text/css" href="login.css" /&gt; 
&lt;link rel="stylesheet" type="text/css" href="menu.css" /&gt; 
&lt;link rel="stylesheet" type="text/css" href="page.css" /&gt; 
} else {
&lt;link rel="stylesheet" type="text/css" href="site.css" /&gt; 
}
</code></pre>

<p>I'll have a msbuild task that will combine all the css files, minimize them and all that good stuff. I just need to know if there is a way to remove the if else branch in the final bits.</p>

[{'answer_id': 50921, 'author': 'jdelator', 'author_id': 438, 'author_profile': 'https://Stackoverflow.com/users/438', 'pm_score': 3, 'selected': False, 'text': '<p>I should had used google.</p>\n\n<pre><code>#if DEBUG\n    Console.WriteLine("Debug mode.") \n#else \n    Console.WriteLine("Release mode.") \n#endif \n</code></pre>\n\n<p>Make sure that the option "Configuration settings" -> "Build" "Define DEBUG \nconstant" in the project properties is checked. </p>\n'}, {'answer_id': 50922, 'author': 'Jonathan Allen', 'author_id': 5274, 'author_profile': 'https://Stackoverflow.com/users/5274', 'pm_score': 1, 'selected': False, 'text': '<p>Compiler constants. I don\'t remember the C# syntax, but this is how I do it in VB:</p>\n\n<pre><code>#If CONFIG = "Debug" Then\n  \'do somtehing\n#Else\n  \'do something else\n#EndIf\n</code></pre>\n'}, {'answer_id': 50966, 'author': 'FlySwat', 'author_id': 1965, 'author_profile': 'https://Stackoverflow.com/users/1965', 'pm_score': 6, 'selected': True, 'text': '<p>Specifically, like this in C#:</p>\n\n<pre><code>#if (DEBUG)\n   Debug Stuff\n#endif\n</code></pre>\n\n<p>C# has the following preprocessor directives:</p>\n\n<pre><code>#if \n#else \n#elif // Else If\n#endif\n#define\n#undef // Undefine\n#warning // Causes the preprocessor to fire warning\n#error // Causes the preprocessor to fire a fatal error\n#line // Lets the preprocessor know where this source line came from\n#region // Codefolding\n#endregion \n</code></pre>\n'}, {'answer_id': 299152, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 3, 'selected': False, 'text': '<pre><code>  if (System.Diagnostics.Debugger.IsAttached)\n  {\n           // Do this\n  }\n  else\n  {\n            // Do that\n  }\n</code></pre>\n'}, {'answer_id': 7766384, 'author': 'Assassin', 'author_id': 294650, 'author_profile': 'https://Stackoverflow.com/users/294650', 'pm_score': 2, 'selected': False, 'text': '<p>You can try to use </p>\n\n<pre><code>HttpContext.Current.IsDebuggingEnabled\n</code></pre>\n\n<p>it is controlled by a   node in configuration. In my opinion this is nicer solution than conditional compilation. </p>\n\n<p>However if you want to be able to control based on a compilation I think you can used a <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.conditionalattribute.aspx" rel="nofollow noreferrer">ConditionalAttribute</a>.</p>\n\n<p>Regards,</p>\n'}]
['https://Stackoverflow.com/questions/50900', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/438/']