I have a clean ASP.Net Core Project but the middleware UseDeveloperExceptionPage() is not working at all,
If I request a non-existing url, the page is blank. :(
I have to add another middleware "app.UseStatusCodePages();" just to see the status error but isn't the UseDeveloperExceptionPage() shows a friendlier error status?
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); if (env.IsDevelopment()) { app.UseStatusCodePages(); //works fine app.UseExceptionHandler("/Home/Error") //<<---not working
app.UseDatabaseErrorPage(); app.UseBrowserLink(); app.UseDeveloperExceptionPage(); //<<<---not working } else { app.UseExceptionHandler("/Home/Error"); } app.UseStaticFiles(); app.UseIdentity(); // Add external authentication middleware below. To configure them please see http://go.microsoft.com/fwlink/?LinkID=532715 app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); }
Environment is already set to "Development".
{"iisSettings": {"windowsAuthentication": false,"anonymousAuthentication": true,"iisExpress": {"applicationUrl": "http://localhost:56271/","sslPort": 0 } },"profiles": {"IIS Express": {"commandName": "IISExpress","launchBrowser": true,"environmentVariables": {"ASPNETCORE_ENVIRONMENT": "Development" } },"CategoryProjectCore": {"commandName": "Project","launchBrowser": true,"launchUrl": "http://localhost:5000","environmentVariables": {"ASPNETCORE_ENVIRONMENT": "Development" } } } }