Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

“Unable to find a table” on Database First Scaffold-DbContext

For some reason I'm getting this error. Below are the specs and then what I did.

Visual Studio 2017 v15.6.2

SQL Server 2008 v10.50.4

I opened the package manager console and added the following packages...

Install-Package Microsoft.EntityFrameworkCore.SqlServer

Install-Package Microsoft.EntityFrameworkCore.Tools

and then I ran

Scaffold-DbContext "Server=ph2srv76;Database=AVDRS;Integrated Security=True;Trusted_Connection=True;" -Provider Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -force

but during the build I get the following errors...

enter image description here

like image 842
Robert Keith Avatar asked Dec 23 '22 08:12

Robert Keith


2 Answers

I hate to post the obvious, but in my case (same error) I was targeting specific tables to model (with -t option) and didn't realize that the table names are case sensitive. Doh!

like image 143
user847335 Avatar answered Mar 15 '23 23:03

user847335


Those are just warnings (yellow), not errors(red) - you can safely ignore them

like image 34
ErikEJ Avatar answered Mar 15 '23 22:03

ErikEJ