No UseDatabaseErrorPage() extension method in Net Core 3.0

C#.NetDatabaseVisual Studio.Net Core

C# Problem Overview


I have created Net Core 3.0 app and following code that worked in 2.2 now is not.

app.UseDatabaseErrorPage();

Looks like in 3.0 class DatabaseErrorPageExtensions does not exist within Microsoft.AspNetCore.Builder namespace. Am I missing some dependency? I have EntityFrameworkCore NuGet with Tools and Design added.

Adding

using Microsoft.AspNetCore.Builder;

not helped.

C# Solutions


Solution 1 - C#

Add a reference to 'Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore', it appears that function is in that package now.

Solution 2 - C#

use

Install-Package Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore -Version 3.1.5

Solution 3 - C#

[CLI]

dotnet add package Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore --version 3.1.2

[StartUp.cs]

using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore;

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionLevvyView Question on Stackoverflow
Solution 1 - C#BrianView Answer on Stackoverflow
Solution 2 - C#M.Ali El-SayedView Answer on Stackoverflow
Solution 3 - C#BatterJimView Answer on Stackoverflow