'ASP.NET Core 5 error “An error occurred while processing your request”

I have published my site made in ASP.NET Core 5 (Visual Studio) in a local folder and I registered it in the Administrator (IIS) I also changed the permissions for the IIS_IUSRS user, however it triggers the following error:

enter image description here

Why this error?

Compiled site:

https://drive.google.com/drive/u/1/folders/1Y-lgQbmjHJa3J5SSx4uIlQsgL-xHKD3Q



Solution 1:[1]

  1. I Have solved this problem after causing me sleepless nights for a month. Go to the folder which you have published your project and look for a folder called Logs

enter image description here

  1. Open the logs folder and check for the following Error, its complaining of appool not added in your respective database

enter image description here

  1. open your SQL server database expend security and right click Logins and select new login.

enter image description here

  1. Enter the Name of the appool that the error on logs is showing and click OK

enter image description here

  1. Go to the login appool that you have just added and right click and choose properties which will open a new window the select user mappings

enter image description here

  1. check your database and two permissions db_datareader and db_datawriter and click ok. Now your application should be working like magic!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Suraj Rao