May 27, 2018

RePost: ASP.NET Core debugging in production environment Windows Server

When you test on staging server errors are suppressed.
On you dev machine you can see error through Visual Studio.

Bottom line use DOTNET.EXE web.dll from command prompt as explained here to see errors.
Quite frustrating after you've spent decade seeing this very same error in your browser in custom errors mode.

https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/troubleshoot?view=aspnetcore-2.0

You should also consider understanding new environment modes in ASP.NET Core.
Again bottom line should be (not been able to make it work :( ) to add good old system environment variable:
ASPNETCORE_ENVIRONMENT

as explained here:

https://andrewlock.net/how-to-set-the-hosting-environment-in-asp-net-core/

Note!
If you require two environment modes to work on same server you'll have to use web.config and defined it inside for each web app separately.

No comments:

Post a Comment