s

asp net core display error page in production edit button Edit

author
Murugan Andezuthu Dharmaratnam | calendar 18 January 2022 | 1523

I was working on an asp .net core application. The application works fine on dev but it throws 500 errors while running on production. I wanted the full exception message to be displayed in production.

Solution

The solution is to modify the Startup.cs file and change the code in Configure method as below.

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }else
            {
                app.UseDeveloperExceptionPage();
            }