Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Team

I am facing this Nuget command issue with my console, basically i want to run DbContext to my project hence its not existing. I ran some packages like EntityFramework.Tools and SqlServer, still i wasnt able to achieve this on time, what could be an issue?

What I have tried:

scaffold-DBContext "Data Source=(LocalDb)\MSSQLLocalDB; Catalog=eNtsaOnlineRegistrationDB;Integrated Security=True" Microsoft.EntityFrameworkCore.SqlServer-OutputDir Models
Posted
Updated 10-Feb-20 22:14pm
Comments
gcogco10 11-Feb-20 2:30am    
I am trying to amend the command to scaffold-DBContext "Data Source=(LocalDb)\MSSQLLocalDB; Catalog=eNtsaOnlineRegistrationDB;Integrated Security=True" Microsoft.EntityFrameworkCore.SqlServer-Verbose, still no luck as to what could be an issue.
Liktor Janos 11-Feb-20 2:44am    
Can you show the exact error message? It would be easier to help if we know more than "still no luck"
gcogco10 11-Feb-20 2:46am    
Unable to find provider assembly with name Microsoft.EntityFrameworkCore.SqlServer-Verbose. Ensure the specified name is correct and is referenced by the project.
Liktor Janos 11-Feb-20 2:50am    
Hm... maybe you should put a space between "SqlServer" and "-Verbose"
The same goes to your first command too with the -OutputDir argument.
Liktor Janos 11-Feb-20 2:49am    
By the way, you should check these:
- Are your connection string settings correct?
- All of your related tables has primary keys?
- Maybe your new files exists, however they are not added to the solution.

1 solution

 
Share this answer
 
Comments
gcogco10 11-Feb-20 5:33am    
Richard McCutchan thanks so much mate, you are star. I had to follow the documentation step by step. Now can able to see my all my DbContext under the Model Folder. Thanks mate dammm what an excercise.
Richard MacCutchan 11-Feb-20 11:51am    
It's always worth going to the documentation first.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900