59
votes

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.

3
Exactly, so this method should be but is not existing. - Levvy

3 Answers

119
votes

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

7
votes

use

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

[CLI]

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

[StartUp.cs]

using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore;