A preferred way to check if asp.net web application is in debug mode during runtime?

后端 未结 3 643
陌清茗
陌清茗 2021-02-02 06:11

During compile time I can do a check like

#if DEBUG
    Log(\"something\");
#endif

But what would be the preferred to check if debug=\"f

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-02 06:56

    HttpContext.IsDebuggingEnabled

    https://docs.microsoft.com/en-us/dotnet/api/system.web.httpcontext.isdebuggingenabled

提交回复
热议问题