【问题标题】:Internal server error 500 asp classic mvc application内部服务器错误 500 asp 经典 mvc 应用程序
【发布时间】:2015-03-11 11:53:07
【问题描述】:

已编辑: 我在其中放置了一个经典的 asp 网站的网络服务器上有一个 MVC 应用程序。我可以让经典的 asp 网站在我的本地机器版本的 IIS 上正常工作,但是当我发布到网络服务器时。发生了三件事。

首先:我在一个框架的页面顶部有一个横幅,这是一个经典的 asp 文件。这加载正确没有问题。请参阅下面的代码。

<!--#include file="./forms/chkfunc.asp"-->
<%
session("MySite") = ImportMySite(ToRootedVirtual("/web.config"), "mysite", false)
 %>
<HTML>
<HEAD>
<link REL="stylesheet" TYPE="text/css" href="main.css">
</HEAD>
<BODY class='top'>


<DIV id="logobox">
<IMG SRC="./images/crest.jpg">
</DIV>

<%
If session("MySite")="restart.dev" Then
    response.write("<DIV id='logotext'>Neurosciences - RESTART - Development</DIV>")
End If

If session("MySite")="restart.training" Then
    response.write("<DIV id='logotext'>Neurosciences - RESTART - Training</DIV>")
End If

If session("MySite")="restart" Then
    response.write("<DIV id='logotext'>Neurosciences - RESTART </DIV>")
End If
%>


<DIV id="logoslice" align='center'>
<IMG SRC="./images/RESTART_logo_only.png">
</DIV>


<DIV id="upperbar"><DIV>
<%
response.write(formatdatetime(now(),1))
%>
</DIV>
</BODY>
</HTML>

其次:我在页面左侧有一个导航栏,位于一个单独的框架中,它加载了一个名为 navbar.asp 的简单 asp 文件。加载此页面时出现内部服务器 500 错误,没有更多详细信息。

第三:我在导航栏右侧的一个单独框架中有一个主要部分,它加载一个名为 body.asp 的简单 asp 文件。加载此页面时给我一个内部服务器 500 错误并且没有更多详细信息。见下面的代码

<!--#include file="dbconnect.asp"-->
<HTML>
<HEAD>
<link REL="stylesheet" TYPE="text/css" href="main.css">
</HEAD>
<BODY class='main'>
<!--#include file="./MyActions/Notifications.asp"-->
<DIV class='textheader'>
Introduction
</DIV>
<DIV class='textbody'>
Welcome to the Restart web portal.
<P>
<% 
'if session("authenticated")="" Then
    If session("authenticated")=1 then  %>
    Please select an item from the menu on the left to continue. Or click on any outstanding notifications above.<BR>To enlarge the font on any of these pages, please depress the CTRL and + keys on your keyboard. Use CTRL and – keys to decrease font size.<BR>To return to the main RESTART site, click here 
    <% else %>
    Please select LOGIN from the navigation bar, on the lefthand menu, to continue using this site.<BR>To enlarge the font on any of these pages, please depress the CTRL and + keys on your keyboard. Use CTRL and – keys to decrease font size.<BR>To return to the main RESTART site, click 
    <%End if%>
</DIV>
<!--#include file="incbot.asp"-->
</FORM>
</BODY>
</HTML>

我很困惑,因为 topbar.asp 有经典的 asp 代码、一个包含文件和 html,因此包含与其他 2 个文件相似的代码,但这些不会加载。

启用errorMode='Detailed' 后收到的错误消息是:

处理 URL 时服务器发生错误。 请联系系统管理员。 如果您是系统管理员请点击这里查找 更多关于这个错误。

有没有人知道我应该在哪里解决这个问题。如果我对所有内容都收到内部 500 错误,我会倾向于认为 IIS 存在问题,但正确加载 3 个页面中的 1 个页面会让我陷入困境。

【问题讨论】:

  • 500 Internal Server 错误说什么是问题所在,您是否了解哪个文件中的哪一行触发了错误?如果没有,您是否在 IIS 中启用了Detailed Errors?您可以发布工作文件的代码以及其中一个错误文件,而没有代码可以从您期望获得的帮助中工作吗? - 见How to Ask
  • 如果您在显示完整错误时遇到问题,这应该会有所帮助 - Classic ASP on IIS7: refusing to send errors to browser on 500 Internal Server Error
  • 查看更新后的问题,这真的取决于#include 文件在body.asp 中的作用,你有很多。如果他们实例化 COM 对象(例如),您是否在部署站点的服务器上安装/注册了这些组件?
  • 只是让您知道那里列出的错误不是详细错误,这是错误未发送到浏览器时显示的默认值。检查 IIS 中的 ASP 部分,在 Debugging properties 下,Send Errors to Browser 设置为 True(这适用于 IIS 7 及更高版本)。见Classic ASP on IIS7: refusing to send errors to browser on 500 Internal Server Error
  • 很遗憾,我无法访问网络服务器的 IIS。不过,我已经向我的服务器管理员询问过这个问题,所以希望很快能收到回复。

标签: asp.net-mvc asp.net-mvc-4 iis asp-classic


【解决方案1】:

因此,在网络服务器上正确设置 IIS 后,现在几乎一切都按预期工作了 :)

【讨论】:

    猜你喜欢
    • 2012-12-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-08
    相关资源
    最近更新 更多