20 Şubat 2019 Çarşamba

How to set ASPNETCORE_ENVIRONMENT to Development Mode in Asp.Net Core MVC Application

Asp.Net MVC Core Application Development Mode 



When we deployed our application to the server and get any eror message then we won't be able to see details of message on previewed page. In this time we may convert our application to development mode via web.config.
In root folder of web.config file  we can add following  lines to child of AspNetCore element.

<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
</environmentVariables>


Result view of config should be as following ;

<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" />
</handlers>
<aspNetCore processPath=".\CMSPortal.WebUI.exe" stdoutLogEnabled="false" >
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
</environmentVariables>
</aspNetCore>
</system.webServer>


Now we able to see all details of error messages :)