3

在我的本地计算机上部署已编译且没有错误的应用程序后,我收到内部服务器 500 错误。部署应用程序的服务器具有大量安全性,因此我需要为每个目录指定读写访问权限。此应用程序使用 Windows 身份验证和 Web 服务通过代理填充下拉框。我认为可能存在连接到 Web 服务的问题,或者文件的读/写安全性问题,或者活动目录身份验证的问题。

我编辑了 web.config,以便使用以下代码显示有关错误原因的更多信息:

<system.web>
  <customErrors mode ="Off"></customErrors>
  <compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
  <trace enabled="true" pageOutput="true" />

  <authentication mode="Windows"/>
   <authorization>
    <allow roles="alg\ADMIN_USER" />
    <deny users="*" />        
  </authorization> 

<client>
  <endpoint address="http://63.236.108.91/aCompService.svc" binding="basicHttpBinding"
    bindingConfiguration="BasicHttpBinding_IAcompService" contract="aComp_ServiceReference.IAcompService"
    name="BasicHttpBinding_IAcompService" />
</client>

我现在收到以下错误:

    500 - Internal server error.

    There is a problem with the resource you are looking for, and it cannot be 
    displayed. 

我想查看带有错误来源的堆栈跟踪。

我应该在 web.config 文件中放入什么以便显示完整的堆栈跟踪?

从本地运行到部署需要在网站上进行哪些更改?

更新-部署人员解除了一些安全读/写限制,现在我明白了

    Parser Error Message: The connection name 'ApplicationServices' was not found in 
    the applications configuration or the connection string is empty. 

为了摆脱错误,我删除了在第 72 行声明的 AspNetSqlRoleProvider,但仍然出现错误。然后我删除了 AspNetWindowsTokenRoleProvider 和所有提供程序信息并得到以下错误:

    Exception message: Default Role Provider could not be found.  

我们的托管都是远程完成的,但服务器人员可以远程登录本地网络服务器。看起来服务器人员没有将文件发布在正确的位置。现在,我现在得到错误:

    There is a problem with the resource you are looking for, and it cannot 
    be displayed.

关于如何解决这些问题的任何想法?

感谢您的关注!

4

3 回答 3

1

通过制作我的配置文件的副本,然后删除一个段,然后一次一步地测试结果,我能够解决同样的问题。我发现在我移除我的handelers 之后它工作得很好。

于 2012-01-05T22:49:08.370 回答
1

也许使用模拟应该有帮助?我在 web.config 中添加了以下内容:

  <authentication mode="Windows"/>
  <identity impersonate="true"/>

我添加了 WriteToEventLog 代码,以便我可以通过该方法跟踪事件日志中的错误。

    Catch Ex As Exception
        WriteToEventLog(Ex.Message, "GetCarriers-Method", EventLogEntryType.Error, "aComp-utility")


    Catch ex As Exception
        WriteToEventLog(ex.Message, "GetMarketingCompanies-Method", EventLogEntryType.Error, "aComp-utility")

也许添加 TraceListenerLog 应该有帮助?

有关此代码的更多信息,请参阅MSDN 。我在 web.config 中添加了以下内容:

 <configuration>
   <system.diagnostics>
     <trace autoflush="false" indentsize="4">
       <listeners>
         <add name="myListener"
           type="System.Diagnostics.EventLogTraceListener"
           initializeData="TraceListenerLog" />
       </listeners>
     </trace>
   </system.diagnostics>
 </configuration>

我还应该在 default.aspx.vb 上添加以下内容吗?

Overloads Public Shared Sub Main(args() As String)

' Create a trace listener for the event log.
Dim myTraceListener As New EventLogTraceListener("myEventLogSource")

' Add the event log trace listener to the collection.
Trace.Listeners.Add(myTraceListener)

' Write output to the event log.
Trace.WriteLine(myTraceListener)

End Sub 'Main
于 2011-05-10T16:17:52.503 回答
1

您是否在应用程序的文件夹层次结构中的另一个位置有一个 web.config,它可能会覆盖您所做的更改?当开发人员将 web.config 复制到一个级别以在进行测试更改时保留它的副本时,我曾经看到过困惑。

这可能是令人头疼的一个来源。

于 2011-05-06T21:16:01.200 回答