Deploying ASP.NET Core API to local IIS error 500


Michael Reno Platama Setavan

I have a problem with my application after deploying to local IIS. I've made an API using ASP.NET Core and have run it on Visual Studio and it works. It can perform GET, POST, PUT and DELETE requests. Then I want to deploy it to local IIS. I have IIS features enabled. And I've followed this tutorial: https://www.youtube.com/watch?v=ZG-6z4BQmRI&ab_channel=AspTricks.net When I run the app, it runs the WeatherForecast default app. However, when I run my API it gives me a 500 error. I've read Microsoft documentation and other tutorials but still can't get it to work. I don't think this will work because it loses the connection to the database, I'm using SQL Server as the database. Here is my project structure.
enter image description here


enter image description here

enter image description here


enter image description here
A side question is, how do I remove the WeatherForecast default app so it doesn't run by default. thanks

Athanasios Kataras

I don't have enough information so I can't help you with your problem, but I can help you with debugging. Your goal should be to find the exception that is causing your api to respond with an error 500. Most likely the connection to the db is broken.

First, let me answer your second question. To delete the weather forecast, just right click and delete:

  1. WeatherForecast.cs
  2. WeatherForecastController.cs
  3. After this, any mention of these 2 breaks your build.

Troubleshooting in Windows and IIS

event viewer

There are two options here. The first is to check the event viewer in the application folder

Here it is : http://www.devtopics.com/how-to-check-the-application-event-log-for-errors/

local debugging

There is an option to debug the application locally on iis as if running the application through the IDE. Check the method here : https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/development-time-iis-support?view=aspnetcore-3.1

Related


Deploying ASP.NET Core API to local IIS error 500

Michael Reno Platama Setavan I have a problem with my application after deploying to local IIS. I've made an API using ASP.NET Core and have run it on Visual Studio and it works. It can perform GET, POST, PUT and DELETE requests. Then I want to deploy it to lo

Deploying ASP.NET Core API to local IIS error 500

Michael Reno Platama Setavan I have a problem with my application after deploying to local IIS. I've made an API using ASP.NET Core and have run it on Visual Studio and it works. It can perform GET, POST, PUT and DELETE requests. Then I want to deploy it to lo

Deploying ASP.NET Core API to local IIS error 500

Michael Reno Platama Setavan I have a problem with my application after deploying to local IIS. I've made an API using ASP.NET Core and have run it on Visual Studio and it works. It can perform GET, POST, PUT and DELETE requests. Then I want to deploy it to lo

Deploying ASP.NET Core API to local IIS error 500

Michael Reno Platama Setavan I have a problem with my application after deploying to local IIS. I've made an API using ASP.NET Core and have run it on Visual Studio and it works. It can perform GET, POST, PUT and DELETE requests. Then I want to deploy it to lo

500 error when deploying asp.net core web api to IIS 7.5

username I have an asp.net core web API project that I am trying to host in IIS 7.5. As suggested in the following article, Could not find configuration file 'appsettings.json', it is not optional Below is my "appsettings.json" file, { "ConnectionStrings": {

ASP.NET Core WebAPI 500 Internal Error in IIS 7.5

james I am trying to get this WebAPI to work. Well, use IIS. Everything works fine in IIS express, but when I publish it, especially 1 api request doesn't work. The url I am trying to access API/[Controller]/{date}/{integer}. I keep getting a 500 server error.

ASP.NET Core WebAPI 500 Internal Error in IIS 7.5

james I am trying to get this WebAPI to work. Well, use IIS. Everything works fine in IIS express, but when I publish it, especially 1 api request doesn't work. The url I am trying to access API/[Controller]/{date}/{integer}. I keep getting a 500 server error.

ASP.NET Core WebAPI 500 Internal Error in IIS 7.5

james I am trying to get this WebAPI to work. Well, use IIS. Everything works fine in IIS express, but when I publish it, especially 1 api request doesn't work. The url I am trying to access API/[Controller]/{date}/{integer}. I keep getting a 500 server error.

ASP.NET Core WebAPI 500 Internal Error in IIS 7.5

Brandon I am trying to get this WebAPI to work. Well, use IIS. Everything works fine in IIS express, but when I publish it, especially 1 api request doesn't work. The url I am trying to access API/[Controller]/{date}/{integer}. I keep getting a 500 server erro

ASP.NET Core MVC causes 500 error on IIS 8.5

Mickey Using .NET Core 3.1, I developed an MVC application and deployed it on IIS 8.5. Using a browser, I can go to the home page when I visit, domain.com/myApp/but I get an http 500 error when I visit domain.com/myApp. This is working locally. The problem occ

ASP.NET Core WebAPI 500 Internal Error in IIS 7.5

james I am trying to get this WebAPI to work. Well, use IIS. Everything works fine in IIS express, but when I publish it, especially 1 api request doesn't work. The url I am trying to access API/[Controller]/{date}/{integer}. I keep getting a 500 server error.

ASP.NET Core WebAPI 500 Internal Error in IIS 7.5

james I am trying to get this WebAPI to work. Well, use IIS. Everything works fine in IIS express, but when I publish it, especially 1 api request doesn't work. The url I am trying to access API/[Controller]/{date}/{integer}. I keep getting a 500 server error.

ASP.NET Core WebAPI 500 Internal Error in IIS 7.5

james I am trying to get this WebAPI to work. Well, use IIS. Everything works fine in IIS express, but when I publish it, especially 1 api request doesn't work. The url I am trying to access API/[Controller]/{date}/{integer}. I keep getting a 500 server error.

ASP.NET Core Web API 500 Internal Server Error

Fear I am trying to build an API within the ASP.NET Core framework. I made a basic controller that just returns a string: namespace Dojo_Api.Controllers.Forum { //[Authorize] [Route("api/[controller")] public class ForumController : Controller

502.5 error when deploying asp.net core website using IIS

Tori E I have an ASP.NET Core 1.0 application that has been successfully deployed and running on a pre-production server for several months. Today I tried to deploy the website to our production server using this article as a guide : https://docs.asp.net/en/la

502.5 error when deploying asp.net core website using IIS

Tori E I have an ASP.NET Core 1.0 application that has been successfully deployed and running on a pre-production server for several months. Today I tried to deploy the website to our production server using this article as a guide : https://docs.asp.net/en/la

502.5 error when deploying asp.net core website using IIS

Tori E I have an ASP.NET Core 1.0 application that has been successfully deployed and running on a pre-production server for several months. Today I tried to deploy the website to our production server using this article as a guide : https://docs.asp.net/en/la

502.5 error when deploying asp.net core website using IIS

Tori E I have an ASP.NET Core 1.0 application that has been successfully deployed and running on a pre-production server for several months. Today I tried to deploy the website to our production server using this article as a guide : https://docs.asp.net/en/la

502.5 error when deploying asp.net core website using IIS

Tori E I have an ASP.NET Core 1.0 application that has been successfully deployed and running on a pre-production server for several months. Today I tried to deploy the website to our production server using this article as a guide : https://docs.asp.net/en/la

502.5 error when deploying asp.net core website using IIS

Tori E I have an ASP.NET Core 1.0 application that has been successfully deployed and running on a pre-production server for several months. Today I tried to deploy the website to our production server using this article as a guide : https://docs.asp.net/en/la

HTTP 500 error with ASP.NET Core application on IIS Express 10

Numirani I believe I have narrowed it down to a misconfiguration, but I can't find where the error lies. Steps to reproduce: Created a new project in Jetbrains Rider 2020.3. ASP.NET Core web application, Windows Authentication. Let the new project build itself