Deploying website: 500 - Internal server error

后端 未结 22 2207
情深已故
情深已故 2020-11-21 23:30

I am trying to deploy an ASP.NET application. I have deployed the site to IIS, but when visiting it with the browser, it shows me this:

Server Error

22条回答
  •  逝去的感伤
    2020-11-22 00:14

    If you're using a custom HttpHandler (i.e., implementing IHttpModule), make sure you're inspecting calls to its Error method.

    You could have your handler throw the actual HttpExceptions (which have a useful Message property) during local debugging like this:

        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;
        }
    

    Also make sure to inspect the Exception's InnerException.

提交回复
热议问题