asp.net core app deployed on iis meets 500 internal server error

后端 未结 10 1826
别那么骄傲
别那么骄傲 2020-12-09 14:29

:( Oops. 500 Internal Server Error An error occurred while starting the application.

This message came out when I added database fu

相关标签:
10条回答
  • 2020-12-09 15:10
    1. Change stdoutLogEnabled="false" to true and then check the logs at stdoutLogFile=".\logs\stdout". The error(s) there might tell you something.

    2. Check that you set up right Environment Name using ASPNETCORE_ENVIRONMENT environment variable as so use correct settings like connection string. On your machine by default you have "Development" environment.

    3. You may use Error Handling middlewares for showing exceptions like

      app.UseDeveloperExceptionPage();
      
    0 讨论(0)
  • 2020-12-09 15:13

    I experienced this issue. The problem was due to my local Sql Server instance. Remote connection were not allowed. So I manually restarted the SQL instance and my App restarted working fine.

    0 讨论(0)
  • 2020-12-09 15:14

    Had the same issue. Here is the guide that helped me. Note, that I did not want to install the "Runtime" on the web server, but rather deploy all the necessary files as a stand alone app. Below are the steps in a more abbreviated form:

    1. On your local PC, Determine which version to publish based on your server. I was targeting Windows Server 2008, R2 which meant i needed to publish win7-x64. Open a command prompt in your project directory and run the command below:

      dotnet publish -c release -r win7-x64

      This creates a publish folder containing hundreds of dlls, an .exe, and web.config located here: bin\Release\netcoreapp2.0\publish

    2. On the web server with IIS, go to this landing page. Click the link for your desired version. Find the link for the Runtime and Hosting Bundle. Click to download and run.

    3. Restart IIS by running this from an elevated command prompt:

      net stop was

      net start w3svc

    4. Copy all of the files in your local publish folder to your desired application folder on the IIS server.

    5. On the server, Open IIS, and create a separate AppPool and Application like normal. For the AppPool, under Basic Settings, change the .NET Framework version to No Managed Code. Make sure your Application in IIS points to your desired folder and the proper AppPool.

    6. Test your web application in a browser.

    0 讨论(0)
  • 2020-12-09 15:19

    Make sure the App Pool has permissions to the folder where your app resides.

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