0

After publishing my asp mvc app to plesk hosting I have 500 error. When I run it locally all works fine.

  1. I checked my connection string. This connection string is correct and uses for another apps that hosts on that server.

  2. Tried to turn on debug and view detailed error message. add such code to my web.config and turn off custom errors on server with turn on debug mode also on server (Plesk)

nothing helps.... (code with configs bellow)

  1. Checked all permissions for files on server.
<system.web>
  <customErrors mode="Off"/>
</system.web>
<system.webServer>
    <httpErrors errorMode="Detailed" />
    <asp scriptErrorSentToBrowser="true" />
</system.webServer>
routes.MapRoute(
                "Test",
                "{controller}/{action}/{GUID}/{questionNumber}",
                new { controller = "Test", action = "Index", GUID = "", questionNumber = "" }  // Parameter defaults
            );

How to resolve it? :(

  • What version of ASP.NET is the server running ? Also check if it is enabled and also check the logs. You will see the error – Bosco Jul 12 '19 at 16:20
  • @Bosco. 4.7 version. In logs i just have an error 441 with message - 80 -- and 1381 with same message. One interesting thing than i can access to another controller (Home/About) but can not Test/NotInvited. I have a custom rout setting. And user by default redirects to Test/NotInvited if he do not have any key in parameter. Updated issue in description to see route settings – Eugene Vajda Jul 12 '19 at 16:33
  • You’re getting a 500, but are you getting a Yellow Screen of Death? Have you tried to capture the error message and log it somewhere? Taking random guesses at routing etc isn’t going to be nearly as productive as looking at the actual error message. – mason Jul 12 '19 at 16:46
  • So i check my code and it works fine locally without any errors but i can not get friendly error screen to debug on server – Eugene Vajda Jul 12 '19 at 17:30
  • https://stackoverflow.com/questions/5385714/deploying-website-500-internal-server-error?rq=1 And tried this issue... – Eugene Vajda Jul 12 '19 at 17:31

2 Answers2

1

For how to find the 500 error which is related with aps.net application in the event viewer, you could refer to below steps:

  1. Go to event viewer enter image description here
  2. Find windows logs-> application

enter image description here

  1. Click the filter current log in the right window and select asp.net 2.0, 4.0. enter image description here
  2. Then it will show the details error content in the event viewer enter image description here
  3. If you want to find the application pool related issue, you could go to the system. enter image description here
  4. Click the filter current log in right window and select WAS. enter image description here
  5. Then you could find the error which is related to the application pool. enter image description here
Jalpa Panchal
  • 8,251
  • 1
  • 11
  • 26
0

So, the problem was in controller name. Just was renamed TestController to ExamController