Ajay Kumar
Ajay Kumar

Reputation: 1164

Aspnet Core app throws develoeper exception on Production

I have hosted AspNetCore app as Azure App service. I have done all the things right but production app still throws developer exceptions.

Code in Configure function:

if (env.IsDevelopment())
{
    app.UseDeveloperExceptionPage();
}
else
{
    app.UseStatusCodePagesWithRedirects("~/Error?statusCode={0}");
    app.UseExceptionHandler("/Error");
}

Azure App Service Configuration: ASPNETCORE_ENVIRONMENT : Production

Upvotes: 1

Views: 269

Answers (1)

Martin Staufcik
Martin Staufcik

Reputation: 9490

Try to delete the environment variable from Azure configuration. The default for ASPNETCORE_ENVIRONMENT variable is production environment.

Upvotes: 1

Related Questions