Issues with EntityFramework. Unable to add-migrations, enable-migrations.
Im learning asp.net mvc and im trying to create a simple database with entity-framework and DbContext. Im encountering an issue where when i try to enable-migrations in NuGet package manager i get an exception thrown "Exception has been thrown by the target of an invocation.".
7 Replies
show the full command you're using
Install-package EntityFramework
Enable-Migrations
If you need the full error message ill gladly share it
I cannot do anything further than enable-migrations
What exactly are you trying to do with
enable-migrations
? Because, as far as I know, that isn't a command
My guess is you're looking for dotnet ef migrations add
Im trying ti create a small data base in the migrations folder. Im using MVC. My professor said enable-migrations creates the migration folder which ill use to fill up my data base
Im using DbSets
And they as he said are like an "excel table"
Im still unfamiliar with databases so thats why im using this
But now that you mention its not a command could it be that the command has been changed?
My friends havent had this issue
I asked this same question on stack overflow they mentioned that i should use an older version but that didnt work
Not sure, but try following the official migration overview docs
Migrations Overview - EF Core
Overview of using migrations to manage database schemas with Entity Framework Core
Ill check it out and see if i can fix it. Ill give an update here if i fix it in hopes someone will find use