Base solution for your next web application
Open Closed

When I change ASPNETCORE_ENVIRONMENT into "Staging" The system can not run correctly #10043


User avatar
0
luo0826 created

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • What is your product version?
  • 9.3.0
  • What is your product type (Angular or MVC)?
  • MVC
  • What is product framework type (.net framework or .net core)?
  • .net core Hi I want to test user frendly error message,I want to see the appearance when I throw exception in MVC controller. so I tried to change environmentVariables in launchSettings.json like this but when I do this the system can not run correctly.It only show a blank page like this.

4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @luo0826,

    The default connection string wrong in appsettings.Staging.json. Please change it with the one in appsettings.json. We will also fix it.

    Thank you.

  • User Avatar
    0
    luo0826 created

    Hi @ismcagdas It works! Thank you very much.Does it mean when I change ASPNETCORE_ENVIRONMENT into Staging or Production I have to copy all of my settings in appsettings.json to appsettings.Staging.json or appsettings.Production.json?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @luo0826,

    No, If there is a setting in appsettings.json and if it doesn't exist in appsettings.Staging.json, then value in appsettings.json will be used. The problem in this case is, appsettings.Staging.json has a wrong value for connection string.

  • User Avatar
    0
    luo0826 created

    Hi @luo0826 thank you very much!