ASP.NET Core hosting - 500 internal server error

user6542823

I am trying to publish as ASP.NET Core project with a hosting provider that supports ASP.NET Core. I am getting 500 Internal Server Error which I believe is very common. So I searched through the internet and various forums and then I checked the processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" in web.config and they look to be correctly converted with processPath="dotnet" and arguments=".\MyApplication.dll".

I also checked the connection string and it points to production DB server that's working. I confirmed the DB connection by changing the connection string to production DB and running project local. It works and I get the production DB access.

I also tried to get the error info by using the below in my Startup.cs (irrespective of env):

app.UseDeveloperExceptionPage();
app.UseDatabaseErrorPage();
app.UseBrowserLink();

I have also enabled stdoutLog in web.config, but I don't see that folder either:

stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout"

I also tried to change applicationUrl and launchUrl in launchSettings.json to my prod Url, but that didn't work as well.

So, the 500 Internal Server Error refuses to go away, and I still don't have a useful error message. The page just says:

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

I would really appreciate if someone could help me here.

Lukasz Makowej

I have also enabled stdoutLog in web.config as but I don't see that folder either:

stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout"

There is one trick here - you must create both folders logs and stdout manually - then and only then IIS will create log file inside logs folder (not stdout as you could expect) - don't ask me why, because I don't know why ;)


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

Usually, means problems with a configuration in Startup.cs - the most common problems include an issue with DB itself, an issue with migrations (if you are using Code First approach), problems with appsettings.js, problems with Social Logins credentials (like missing SecretKey)...

Please refer to log file in .\logs\stdout - this is the quickest way to find details about the problem :)


app.UseDeveloperExceptionPage();

app.UseDatabaseErrorPage();

Those will work after your WebApp fully started, but not while starting the application.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

ASP.NET Core 2.2 Web API Angular. Hosting provider says 500 - Internal server error

ASP.NET Core Web API 500 Internal Server Error

asp.net core app. 500 - Internal server error

500 Internal Server Error Hosting

“500 - Internal server error” when calling ASP .Net Core 2.1.7 micro-service on Windows Server

500 internal Server Error on Shared hosting

AJAX POST 500 Internal Server Error on hosting

Asp.Net Core 2 Web API 500 internal server error

ASP.NET Core API - 500 internal server error,only on production

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

ASP.NET Core API 500 Internal Server Error when uploading file on IIS

500 Internal Server Error when Regex fails in C# data annotation asp.net core 2

ASP.NET CORE Hosting - Error Internal Server Error Handler "aspNetCore" has a bad module "AspNetCoreModule" in its module list

ASP.NET Core WebAPI 500 Internal error in IIS 7.5

500 Internal Server Error when hosted .net Core App in Docker

500 Internal Server Error in ASP.NET MVC Bundles

500 Internal Server Error on JSON Post ASP.net MVC

ASP.NET IIS Application 500 Internal Server Error

After hosting to server symfony gives 500 internal server error

Getting 500 Internal Server Error on my cpanel hosting?

Asp net core publish on azure app services 500 server error

Error 500: Hosting .net Core 6 app into IIS on Windows Server 2016

Web application using c#.net Core internal server error 500

403 Forbidden/500 Internal Server Error after deploying .net core api AWS Serverless application

ASP.NET Call to API Endpoint returns 500 - Internal Server Error

ASP.NET Identity Google Callbackpath throwing internal server error 500

ASP.NET 500 Internal Server Error while calling webmethod from javascript

Ajax request for asp.net mvc controller returning 500 - internal server error

ASP.NET cannot get rid of "500- Internal server error"