質問

これまで約10短cssファイルで使用するwebアプリです。あのような エラーになります。css ログインします。css など---。かといった短cssファイルを更新-編集まで行ってくださいますようお願い少なくともしました。だいさんの最適化とともに、これまでの場合にも支店を取り込んでいるとはいえない範囲内で最後のビット.もう少し前向きなことをやりたいこのような

if(Debug.Mode){

<link rel="stylesheet" type="text/css" href="error.css" /> 
<link rel="stylesheet" type="text/css" href="login.css" /> 
<link rel="stylesheet" type="text/css" href="menu.css" /> 
<link rel="stylesheet" type="text/css" href="page.css" /> 
} else {
<link rel="stylesheet" type="text/css" href="site.css" /> 
}

よって詐欺サイトだと思い、msbuildタスクをすべてのcssファイルは、最小化し、すべてのことをいいます。私が知る必要がある場合を除の場合にも支店を最後のビット.

役に立ちましたか?

解決

具体的には、このようなクライアントまで、フルのC#:

#if (DEBUG)
   Debug Stuff
#endif

C#には以下のプ指令について:

#if 
#else 
#elif // Else If
#endif
#define
#undef // Undefine
#warning // Causes the preprocessor to fire warning
#error // Causes the preprocessor to fire a fatal error
#line // Lets the preprocessor know where this source line came from
#region // Codefolding
#endregion 

他のヒント

  if (System.Diagnostics.Debugger.IsAttached)
  {
           // Do this
  }
  else
  {
            // Do that
  }

ったです。

#if DEBUG
    Console.WriteLine("Debug mode.") 
#else 
    Console.WriteLine("Release mode.") 
#endif 

このオプション"設定"->"ビルド""デバッグの定義 定"プロジェクトの物件をチェックします。

滞在ビザを取得することができ用

HttpContext.Current.IsDebuggingEnabled

で制御されるノードを設定します。私の意見はすぐにより解条件とします。

しかしだしていきたいと考えている制御に基づく作成できる思いますので使用 ConditionalAttribute.

について

コンパイラの定数.記憶してないはC#の構文が、このようにのんびりとしていますのでVB:

#If CONFIG = "Debug" Then
  'do somtehing
#Else
  'do something else
#EndIf
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top