Sunday, 12 July 2020

.Net Core ASPNETCORE_ENVIRONMENT Variable

If you are working with .Net Core and something wrong has happened and you see the below screen, and need to know the details of the exception


By default, the ASPNETCORE_ENVIRONMENT variable is set to Production to prevent showing sensitive data to end-users
Add the below lines to your web.config to show the details of the error 
<aspNetCore processPath=".\MyApplication.exe" arguments="" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout">
      <environmentVariables>
        <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
      </environmentVariables>
    </aspNetCore>

No comments:

Post a Comment