Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Team

I want to create Add-Migration eNtsaMigration, i kept receiving this message each time. I have installed all the required packages on my project. Especially for creating Migration. What could be an issue?
No DbContext was found in assembly 'eNtsaRegistrationTraining'. Ensure that you're using the correct assembly and that the type is neither abstract nor generic.


What I have tried:

Install-Package
Microsoft.EntityFrameworkCore.Design

Add-Migration eNtsaMgration
Posted
Updated 19-Oct-21 6:40am

You have to specify the project name where the DbContext is located.

Write something like below in the Nuget Package Manager Console:
C#
Add-Migration MigrationName -Project YourProjectName
 
Share this answer
 
Comments
gcogco10 28-Jul-20 9:53am    
I have tried this and i am still getting that more. It only shows build success, but no folder under that name under project folder. Any ideas?
dd-Migration TheNewmigrationName -Project TargetProjectNam
 
Share this answer
 

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