c# - web.config中如何判断是否编译调试="true"

标签 c# asp.net debugging

我在这里为应该简单的东西画了一个空白......

我正在尝试做类似的事情:

    <my:control runat="server" id="myid" Visible="<%= (is compilation debug mode?) %>" />

最佳答案

HttpContext.IsDebuggingEnabled property :

using System.Web;

if (HttpContext.Current.IsDebuggingEnabled) { /* ... */ }

来自文档:

Gets a value indicating whether the current HTTP request is in debug mode[…] true if the request is in debug mode; otherwise, false.

关于c# - web.config中如何判断是否编译调试="true",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6193010/

相关文章:

c# - 如果 else 语句不起作用

c# - View 模型公开的集合必须使用 MVVM 模式实现 ObservableCollection<T>

asp.net - 如何在 ASP.Net MVC2 中完成这种类型的 URL?

ruby - 如何使用 Aptana Studio 3 和 rbenv 调试 Ruby 脚本?

asp.net - Visual Studio 2013 : cannot see drop down to start debugging with any browser

c++ - 在静态/动态库混合中链接 Debug-CRT 时崩溃?

c# - .Net 简单正则表达式二次复杂度

c# - 防止 Thread.CurrentPrincipal 跨应用程序域传播

c# - "' HttpRequestMessageProperties ' does not contain a definition for ' PathHandler '"尽管使用 System.Web.Odata.Extensions

asp.net - 在本地主机上调试时使用 SIignalR 针对 Azure 移动服务启用身份验证