Getting 500 error code from asp.net core app on IIS 8.5 Windows Server 2012 but works fine on console


adeel41

title:

500 error code when running asp.net core application on Windows Server 2012 IIS 8.5 but when executed from command line by specifying the generated exe file i.e. "MyApplication.exe" it works fine

detail:

It doesn't generate any error logs and has nothing to do with this in Windows Event Viewer, so I don't know what's going on. I'm pretty sure the problem is not in the generated package (using dotnet publish) as it is generated via TeamCity and then deploying the same package to different machines, and with OctopusDeploy the host site is also automatically created and the method works on other machines. On a non-working machine, there are a few differences:

  • It installed dotnet-core RC1 (it was uninstalled before deployment process)
  • The HttpPlatformHandler module is registered in the IIS module (I removed the module and it still doesn't work)
  • OS is Windows Server 2012 (while other machines are 2008 and 2012 R2)

I did the following but it always gave me a 500 error code, no errors in the log and no related events in the windows event viewer.

  • Created an app_offline.htm file but same result
  • iisreset (many times, when I make changes in IIS)
  • Reboot the machine (only 2 times)
  • reinstall asp net core module (manually and fix)
  • Grant read, write, execute access to the default AppPool {{ApplicationName} in this folder
  • Change the application pool identity to the admin user

I think the problem is between IIS and the ASPNET core module, since this application does work in the console. And I'm also sure the web.config is correct, since on the other two machines in the web.config it's instructed to run ".{{MyApplication}}.exe"

I'll be spending the whole day with any help, and will have no other energy to do this tomorrow, so any help would be greatly appreciated.

adeel41

I solved my own problem. If anyone has the same problem, here is the solution.

The application pool for the dotnet core application has BUT no managed codeselected , but also make sure Managed pipeline mode it is set toClassic

Related


How to deploy ASP.Net MVC 5 to IIS 8 Windows Server 2012?

MJ X I developed an application in ASP.Net MVC 5 with database SQL Server 2012 and now I want to deploy it in Windows Server 2012 with IIS 8 I followed this link : http://www.asp.net/mvc/overview/deployment/visual-studio-web-deployment/deploying-to-iis But whe

How to deploy ASP.Net MVC 5 to IIS 8 Windows Server 2012?

MJ X I developed an application in ASP.Net MVC 5 with database SQL Server 2012 and now I want to deploy it in Windows Server 2012 with IIS 8 I followed this link : http://www.asp.net/mvc/overview/deployment/visual-studio-web-deployment/deploying-to-iis But whe

How to deploy ASP.Net MVC 5 to IIS 8 Windows Server 2012?

MJ X I developed an application in ASP.Net MVC 5 with database SQL Server 2012 and now I want to deploy it in Windows Server 2012 with IIS 8 I followed this link : http://www.asp.net/mvc/overview/deployment/visual-studio-web-deployment/deploying-to-iis But whe

How to deploy ASP.Net MVC 5 to IIS 8 Windows Server 2012?

MJ X I developed an application in ASP.Net MVC 5 with database SQL Server 2012 and now I want to deploy it in Windows Server 2012 with IIS 8 I followed this link : http://www.asp.net/mvc/overview/deployment/visual-studio-web-deployment/deploying-to-iis But whe

How to deploy ASP.Net MVC 5 to IIS 8 Windows Server 2012?

MJ X I developed an application in ASP.Net MVC 5 with database SQL Server 2012 and now I want to deploy it in Windows Server 2012 with IIS 8 I followed this link : http://www.asp.net/mvc/overview/deployment/visual-studio-web-deployment/deploying-to-iis But whe

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.

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