C## if/#ifdef语法不能编译,为什么?

Ste*_*ger -1 .net c# syntax conditional-compilation

为什么下面的代码没有编译(片段)?

  public enum ApplicationType : int
  {
   CONSOLE = 1,
   WINDOWS_FORMS = 2,
   ASP_NET = 3,
   WINDOWS_SERVICE = 4,
   MUTE = 5
  }

        //#if( false)
        //#if (DEBUG && !VC_V7)
 #if( m_iApplicationType != ApplicationType.ASP_NET  )
        public class HttpContext
  {
   public class Current
   {
    public class Response
    {
     public static void Write(ref string str)
     {
      Console.WriteLine(str);
     }
    }
   }
  }
#endif
Run Code Online (Sandbox Code Playgroud)

Dan*_*nas 5

你遇到了什么错误?

在任何情况下,( m_iApplicationType == ApplicationType.ASP_NET )都不是编译时常量.