0
votes

I recently developed a new web application with ASP.NET MVC Core, using the (at the time) latest .NET build: 5.0. On the local IIS web server, the apps runs fine and can connect to the database. While in production, however, I only get a note that says I have to be in development mode to see more details on the error(s).

Thus my question, if my launchsettings are set to a Development environment:

"profiles": {
"IIS Express": {
  "commandName": "IISExpress",
  "launchBrowser": true,
  "environmentVariables": {
    "ASPNETCORE_ENVIRONMENT": "Development",
    "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation"
  }
}

And my web app has been published in "Debug" mode. What else can I do to get my (now online) web app to elaborate on the error(s) it is experiencing?

This is the error message during production runtime, as soon as I attempt to access a data page:

Error. An error occurred while processing your request. Request ID: 00-b6a4317779144a43ab28d33258720bbf-4eed6df4e6152246-00

Development Mode Swapping to Development environment will display more detailed information about the error that occurred.

The Development environment shouldn't be enabled for deployed applications. It can result in displaying sensitive information from exceptions to end users. For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development and restarting the app.

Is there another setting I can tweak to ensure the application launches into development mode? Just so that I can get more information on this phantom error?

Thank you very much in advance!

1
see your log.txt file for details.Sabir Hossain
Hi Sabir, this is running on the production web server. I won't have access to a Log.txt file, if that file is stored to a local directory during runtime... Or, is there somewhere else I can check for such a log file?Hendrik Potgieter

1 Answers

0
votes

Do you have access to the physical server or control panel? If you do, something you could try is:

Control Panel > System > Advanced system settings and add or edit the ASPNETCORE_ENVIRONMENT value.

Hope this helps - it has worked on our testing servers!