Deploying website: 500 - Internal server error

后端 未结 22 2184
情深已故
情深已故 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:00

    Make sure your account uses IIS 7. For more information, see Customizing IIS Settings on Your Windows Hosting Account. Follow the instructions in Changing Pipeline Mode on Your Windows IIS 7 Hosting Account. Select Integrated Pipeline Mode. In your Project References section, set Copy Local to True for the following assemblies:

    System.Web.Abstractions
    System.Web.Helpers
    System.Web.Routing
    System.Web.Mvc
    System.Web.WebPages
    

    Add the following assemblies to your project, and then set Copy Local to True:

    Microsoft.Web.Infrastructure
    System.Web.Razor
    System.Web.WebPages.Deployment
    System.Web.WebPages.Razor
    Publish your application.
    
    0 讨论(0)
  • 2020-11-22 00:00

    Try compiling in Debug mode (in Visual Studio). If you are in Release mode, a lot of URL Rewrite errors will not be available.

    Image shows the Debug selection combobox in Visual Studio

    0 讨论(0)
  • 2020-11-22 00:01

    My first attempt to publish and then run a very simple site serving only HTML produced "The page cannot be displayed because an internal server error has occurred."

    The problem: I had the site set to .NET 3.5 in Visual Studio (right click web site project -> Property Pages -> Build), but had the Web Site in Azure configured as .NET 4.0. Oops! I changed it to 3.5 in Azure, and it worked.

    0 讨论(0)
  • 2020-11-22 00:04

    For IIS 8 There is a extra step to do other than changing the customErrors=Off to show the error content.

    <system.web>
       <customErrors mode="Off" />
    </system.web>
    <system.webServer>
       <httpErrors existingResponse="PassThrough" errorMode="Detailed"/>
    </system.webServer>
    

    Raul answered the question in this link Turn off IIS8 custom errors by Raul

    0 讨论(0)
  • 2020-11-22 00:06

    In my case, I put a mistake in my web.config file. The application key somehow was put under the <appSettings> tag. But I wonder why it doesn't display a configuration error. The error 500 is too generic for investigating the problem.

    0 讨论(0)
  • 2020-11-22 00:06

    If you are using IIS 8.5 it may be that you need to change the ApplicationPool ID setting from ApplicationPoolId to NetworkService

    Right click the Application Pool in question, click on "Advanced Settings" and then scroll down to ID - it will probably be set to ApplicationPoolIdentity. Click the button (..) and select NetworkService from the dropdown list instead.

    Also make sure that if it is a .NET 2.0 application that you are not referencing the 4.0 framework in your App Pool.

    0 讨论(0)
提交回复
热议问题