我正在尝试部署一个ASP。网络应用程序。我已经将网站部署到IIS,但当用浏览器访问它时,它显示给我这个:

服务器错误 500 -内部服务器错误。 您正在查找的资源有问题,无法显示。

在摆弄了网页之后。配置,我得到:

由于内部服务器错误,页面无法显示。

我如何才能看到这个服务器错误背后的实际问题?


当前回答

尝试在Debug模式下编译(在Visual Studio中)。如果您处于发布模式,许多URL重写错误将不可用。

图为Visual Studio中的调试选择组合框

其他回答

对于那些有这种可能性的人(VPS托管而不是网络托管):

通过远程桌面连接到托管服务器。从远程桌面打开Web浏览器,您将看到错误的详细描述。

你不需要修改web。配置或暴露任何细节给任何人。

500内部服务器错误可能由以下几个原因引起。第一个原因可能是网络。配置文件没有正确创建,这意味着您在web中错过了一些标签。配置文件。其次,这个错误可能是由于一些代码问题。要检查web应用程序的哪个组件导致此错误,您可以检查web中的应用程序设置。配置文件。解决和跟踪500个服务器内部错误的详细图如下:

如果您正在使用自定义HttpHandler(即实现IHttpModule),请确保您正在检查对其Error方法的调用。

你可以让你的处理程序在本地调试期间抛出实际的httpexception(它有一个有用的Message属性),如下所示:

    public void Error(object sender, EventArgs e)
    {
        if (!HttpContext.Current.Request.IsLocal)
            return;
        var ex = ((HttpApplication)sender).Server.GetLastError();
        if (ex.GetType() == typeof(HttpException))
            throw ex;
    }

还要确保检查异常的InnerException。

我最近遇到了同样的问题,服务器上的磁盘空间已满。清理一些空间解决了这个问题。

Before changing the web.config file, I would check that the .NET Framework version that you are using is exactly (I mean it, 4.5 != 4.5.2) the same compared to your GoDaddy settings (ASP.Net settings in your Plesk panel). That should automatically change your web.config file to the correct framework. Also notice that for now (January '16), GoDaddy works with ASP.Net 3.5 and 4.5.2. To use 4.5.2 with Visual Studio it has to be 2012 or newer, and if not 2015, you must download and install the .NET Framework 4.5.2 Developer Package. If still not working, then yes, your next step should be enabling detailed error reporting so you can debug it.