如何查看特定的错误/堆栈跟踪,以便查明我的网站问题?

时间:2015-02-11 18:11:47

标签: visual-studio-2010 asp-classic

我正在处理一个页面,我希望能够查看堆栈跟踪,以便我能够指出问题所在。如果你转到http://www.phrd.com/cattorney-bio.asp?AttorneyID=569,你会发现它只是给你一般的HTTP 500错误。我希望能够看到具体的错误。我记得它与web.config文件有关,但我不记得它是什么设置。我只想暂时这样做,我会把它关掉。我认为它将customeError设置变为false,但必须有更多内容。

当我的页面中有一组代码时,它会给我500错误。以下是我的代码:

<%    
    strSQL5 = "SELECT * FROM ADVISORIES WHERE ATTY_ID="& AttorneyID& " AND Category = 'Employee' ORDER BY Date() ASC"
    set r5 = d2.Execute(strSQL5)
    if (r5.EOF = True) and (r5.BOF = True) then

    else
        r5.movefirst
%>

            <br />  <h3><span>Archived Advisories</span></h3>
            <p>
                <i>Employee Testing</i>
            </p>

                <ul id="ul1">

<%
        cnt=0
        while (r5.EOF = false) and (r5.BOF = false)
        cnt=cnt+1
%>

                    <li><a href="~/docs/" & <%= r5("Filename") %>target="_blank"><%= r5("DisplayText") %></a></li>
<%
            r5.movenext
        wend
%>

                </ul>
<%
    end if
%>          

<%

    strSQL6 = "SELECT * FROM ADVISORIES WHERE ATTY_ID="& AttorneyID& " AND Category = 'Wage' ORDER BY PubDate ASC"
    set r5 = d2.Execute(strSQL6)
    if (r5.EOF = True) and (r5.BOF = True) then

    else
        r5.movefirst
%>


            <p>
                <i>Wage and Hour</i>
            </p>

                <ul id="ul2">

<%
        cnt=0
        while (r5.EOF = false) and (r5.BOF = false)
        cnt=cnt+1
%>

                    <li><a href="~/docs/"<% r5("Filename") %>" target="_blank"><% r5("DisplayText") %></a></li>
<%
            r5.movenext
        wend
%>

                </ul>
<%
    end if
%>

这是我的web.config文件:

<system.web>
<!-- 
        Set compilation debug="true" to insert debugging 
        symbols into the compiled page. Because this 
        affects performance, set this value to true only 
        during development.
    -->
<trace enabled="true" pageOutput="true" />
<compilation debug="true" targetFramework="4.0">
  <assemblies>
    <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
    <add assembly="System.Data.Services.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
  </assemblies>
</compilation>
<!--
        The <authentication> section enables configuration 
        of the security authentication mode used by 
        ASP.NET to identify an incoming user. 
    -->
<authentication mode="Forms">
  <forms name="FormsAuthentication" path="/" loginUrl="login.aspx" timeout="20" />
</authentication>
<authorization>
  <allow users="*" />
</authorization>
<membership defaultProvider="AccessMembershipProvider">
  <providers>
    <clear />
    <add name="AccessMembershipProvider" type="AccessProvider.AccessMembershipProvider" connectionStringName="UsersDB" />
  </providers>
</membership>
<roleManager enabled="true" defaultProvider="AccessRoleProvider">
  <providers>
    <clear />
    <add name="AccessRoleProvider" type="AccessProvider.AccessRoleProvider" connectionStringName="UsersDB" />
  </providers>
</roleManager>
<customErrors mode="Off" />

2 个答案:

答案 0 :(得分:0)

首先,您使用的是ASP Classic技术不是 ASP.NET。

您最好的选择是使用失败的请求跟踪规则。

以下是分三个步骤开启的方法。

我为你拍了一些屏幕截图:

  1. 在IIS中选择该网站,然后点击Failed Request Tracing rules
  2. enter image description here

    1. 在右侧操作窗格中,点击Failed Request Tracing
    2. enter image description here

      1. 选中启用复选框,并指定路径:
      2. enter image description here

        就是这样,现在导航到此路径,您将找到您网站的文件夹。

        在该文件夹的内部,您将看到xml文件。你可以在浏览器中查看它们,它们使用样式表,因此格式很好。

        编辑:

        如果您遇到问题请点击此链接:

        Using Failed Request Tracing Rules to Troubleshoot Application Request Routing (ARR)

答案 1 :(得分:-1)

在visual studio中转到属性并选择构建并在配置部分选择从下拉列表中调试

或者在web.config中设置debug = true in compilation tag Eg

<compilation debug="true" targetFramework="4.5">