C# directive for code to run only when working on localhost
<p>Is there any directive in C# that runs a code (server side code) only when the application runs on localhost and ignores it on production (not the debug true or false)?</p>

<p>It can be something that reads a web.config appsettings variable, if it's true, run the code, if it's false, ignore it (just an idea).</p>
