Search code examples
c#sql-serverasp.net-mvctwitter-bootstrapadminlte

HTTP 500 errors after publishing MVC 5 project


I am currently developing a MVC 5 web project using AdminLTE template. When I debug on Visual Studio, there is no problem but if I publish the project and test on my local IIS server, it gives HTTP 500 error.

I checked the all controllers and views and found somethings. On one view I used mysql connection and there is no problem there. Page is working properly, but sql server used pages are not working. Also I used SQL server model on login page. It also works well. Just SQL server connections doesn't work.

I am using SQL Server Express on my machine,
remote mysql,
.NET Framework 4.6.1,
AdminLTE template,
latest IIS server.

I also tried on windows server 2012 r2 standard with SQL Server 2008 r2. I configured web.config but still getting the same errors.

sql used view

mysql used view


Solution

  • Thank you for your suggestions. I solved to problem. I will explain it step by step.

    1. I added log4net package to solution by NuGet
    2. Configured it by the following link
    3. Checked the log file and saw following error : Login failed for user 'IIS APPPOOL\user'.
    4. Then I solved that problem according to this solution

    Now the project works perfect, thanks.