ASP.NET Diagnostic Page to Dump ASP.NET and Environment Configuration

<%@ Page Language="C#" AutoEventWireup="true" Trace="true" TraceMode="SortByCategory" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title>ASP.NET Diagnostic Page</title>
</head>
<body>
  <form id="form1" runat="server">
  
  <h2>Environment Variables</h2>
  <pre>
  <table>  
<%
    var variables = Environment.GetEnvironmentVariables();
    foreach (DictionaryEntry entry in variables)
    {
      Response.Write("<tr><td>");
      Response.Write(entry.Key);
      Response.Write("</td><td>");
      Response.Write(entry.Value);
      Response.Write("</td></tr>");
    }
  %>
  </table>
  </pre>

  <h2>Misc</h2>
  <pre>
  Response.Filter = <%= Request.Filter.ToString() %>
  Request.ApplicationPath = <%= Request.ApplicationPath %>
  Request.PhysicalApplicationPath = <%= Request.PhysicalApplicationPath %>
  Request.PhysicalPath = <%= Request.PhysicalPath %>
  Request.UrlReferrer = <%= Request.UrlReferrer %>
  Request.UserLanguages = <%= string.Join(",", (Request.UserLanguages ?? new string[0])) %>
  </pre>
  
  </form>
</body>
</html>

Source: http://www.codeproject.com/Articles/229356/ASP-NET-Diagnostic-page-to-dump-ASP-NET-and-Enviro

Advertisements

File Attribute And Things To Remember

If you wanted to include another .config file within your websites web.config you can reference it as a property of

Example:

<appSettings file="appconfig\custselfserv\custselfserv.config">

Note that appconfig\custom\secretconfig.config is relative to the root of your website.

Including extra configuration files are useful for cases where you want to lock down production process ID’s and other secret settings. You can grant your production management team and IIS access to /appconfig which would conceal the settings from being read by say developers.

One thing to remember is if you change settings in this included file the IIS app pool will need to be refreshed for the changes to be picked up. web.config changes will induce an app pool refresh however included files will not automatically.