0
ajayak created
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
Also tried to delete environment variable on azure as it points to Production by default but still no luck
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)
2 Answer(s)
-
1
click to your site → All Settings → Application settings:

Add an app setting in the "App settings" section:

You can verify the value from the debug console: https://{your site name}.scm.azurewebsites.net/DebugConsole
Also check your web.config. Sometimes
ASPNETCORE_ENVIRONMENTis being set in web.config and it's forgotten.See
- https://stackoverflow.com/a/40515803/1767482
- https://stackoverflow.com/a/57289014/1767482
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0

