- You can change ASPNETCORE_ENVIRONMENT from "Production" to "Development".
- Add
ASPNETCORE_ENVIRONMENT
with value: Development in Azure Portal.
Go to AzurePortal => your Web App =>Configuration => "Applications Settings" => add the “ASPNETCORE_ENVIRONMENT”
and “Development”
- In Startup.cs, change the code for the Configure () method .
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseDeveloperExceptionPage();
...
}
- Modify your web.config file with the below. If you dont have a web.config , add one.
<aspNetCore processPath="dotnet" arguments=".\projectName.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout">
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
</environmentVariables>
</aspNetCore>
OR
The web.config in its entirety should resemble the below (update "projectName.dll" for your project appropriately):
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\projectName.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" >
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
</environmentVariables>
</aspNetCore>
</system.webServer>
</location>
</configuration>
Please refer these similar issue articles A1 , A2 , A3 for more information.