C
C#7mo ago
гого

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
Keswiik
Keswiik7mo ago
show the full command you're using
гого
гогоOP7mo ago
Install-package EntityFramework Enable-Migrations If you need the full error message ill gladly share it I cannot do anything further than enable-migrations
Keswiik
Keswiik7mo ago
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
гого
гогоOP7mo ago
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
Keswiik
Keswiik7mo ago
Not sure, but try following the official migration overview docs
Keswiik
Keswiik7mo ago
Migrations Overview - EF Core
Overview of using migrations to manage database schemas with Entity Framework Core
гого
гогоOP7mo ago
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
Want results from more Discord servers?
Add your server