[Solved-4 Solutions] Deploying website: 500 - Internal server error



Error Description:

    • When we try to deploy an ASP.NET application, after deploying the site to IIS, when visiting it with the browser, it shows this:

    Server Error 500 - Internal server error.

    • There is a problem with the resource you are looking for, and it cannot be displayed.
    • web.config:
    • The page cannot be displayed because an internal server error has occurred.

    Solution 1:

      • First, you need to enable and see detailed errors of your web messages, because this is a general message without giving information on what's really happening for security reasons.
      • With the detailed error, you can locate the real issue here.
      • Also, if you can run the browser on the server, you get details on the error, because the server recognizes that you are local and shows it to you. Or if you can read the logb> of the server using the Event Viewer, you also see the details of your error.

      On IIS 6 On IIS 6

      <configuration>
          <system.web>
              <customErrors mode="Off"/>
              <compilation debug="true"/>
          </system.web>
      </configuration>
      
      click below button to copy the code. By asp.net tutorial team

      On IIS 7

      <configuration>
          <system.webServer>
              <httpErrors errorMode="Detailed" />
              <asp scriptErrorSentToBrowser="true"/>
          </system.webServer>
          <system.web>
              <customErrors mode="Off"/>
              <compilation debug="true"/>
          </system.web>
      </configuration>
      
      click below button to copy the code. By asp.net tutorial team

      Note: You can avoid the Debug=true. You only need to close the custom errors for a while and get the detailed error page.

      Solution 2:

        • Making sure the following entry was in the root web.config file fixed it for me:
        <configuration>
          <system.webServer>
            <validation validateIntegratedModeConfiguration="false" />
          </system.webServer>
        </configuration>
        
        click below button to copy the code. By asp.net tutorial team
        • Remember that you have to add this to the existing XML elements, if they're already there. You can't just add at the end of the file, because you can't have multiple copies of any element.

        Solution 3:

          • Make sure to change the existingResponse attribute of the httpErrors node to Auto from Replace, or to remove that property entirely.
          <httpErrors existingResponse="Replace" />
                                        ^^^^^^^ not going to work with this here
          
          click below button to copy the code. By asp.net tutorial team

          Solution 4:

            • Probably your web.config file is wrong or is missing some tag. Check it.

            Related Searches to Deploying website: 500 - Internal server error