Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No UseDatabaseErrorPage() extension method in Net Core 3.0

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.

like image 836
Levvy Avatar asked Oct 01 '19 11:10

Levvy


Video Answer


2 Answers

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

like image 84
Brian Avatar answered Sep 19 '22 08:09

Brian


use

Install-Package Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore -Version 3.1.5 
like image 44
M.Ali El-Sayed Avatar answered Sep 19 '22 08:09

M.Ali El-Sayed