Base solution for your next web application
Open Closed

Web API - An error occured while starting the application #6174


User avatar
0
kythor created

I manage to run the Web API on my local machine, but when i publish it to Azure I get this error:

in the Chrome developers tool I just see a "500 internal server error" message.

any help is appreciated


3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    Look at the IIS logs according to the tips of this article. https://scottsauber.com/2017/04/10/how-to-troubleshoot-an-error-occurred-while-starting-the-application-in-asp-net-core-on-iis/

  • User Avatar
    0
    kythor created

    its an Azure webapps, so not sure where exactly i should find the IIS logs there. I turned on Diagnostic Logs on the webapp, but the only thing I get when i try to load the API is this:

    IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.</li> <li>IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.</li> <li>IIS was not able to process configuration for the Web site or application.</li> <li>The authenticated user does not have permission to use this DLL.</li> <li>The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.</li> </ul>

  • User Avatar
    1
    kythor created

    fixed it. The ASPNETCORE_ENVIRONMENT was set in azure to "Production", which is good. But then i looked at my appsettings.production.json and there seemed to be a } missing...

    So make sure the appsettings structure is always correct ;)