C
C#11mo ago
Gipper

✅ I can't do migrations now...

when I do add-migration nullableForeignsOnPublicacao I get:
PM> add-migration nullableForeignsOnPublicacao
Both Entity Framework 6 and Entity Framework Core are installed. The Entity Framework 6 tools are running. Use 'EntityFrameworkCore\Add-Migration' for Entity Framework Core.
A version of Entity Framework older than 6.3 is also installed. The newer tools are running. Use 'EntityFramework\Add-Migration' for the older version.
No migrations configuration type was found in the assembly 'Trabalho Lab Aplicações Web'. (In Visual Studio you can use the Enable-Migrations command from Package Manager Console to add a migrations configuration).
PM> add-migration nullableForeignsOnPublicacao
Both Entity Framework 6 and Entity Framework Core are installed. The Entity Framework 6 tools are running. Use 'EntityFrameworkCore\Add-Migration' for Entity Framework Core.
A version of Entity Framework older than 6.3 is also installed. The newer tools are running. Use 'EntityFramework\Add-Migration' for the older version.
No migrations configuration type was found in the assembly 'Trabalho Lab Aplicações Web'. (In Visual Studio you can use the Enable-Migrations command from Package Manager Console to add a migrations configuration).
So I tried Enable-Migrations, right? I got:
PM> Enable-Migrations
Both Entity Framework 6 and Entity Framework Core are installed. The Entity Framework 6 tools are running. Use 'EntityFrameworkCore\Enable-Migrations' for Entity Framework Core.
A version of Entity Framework older than 6.3 is also installed. The newer tools are running. Use 'EntityFramework\Enable-Migrations' for the older version.
No context type was found in the assembly 'Trabalho Lab Aplicações Web'.
PM> Enable-Migrations
Both Entity Framework 6 and Entity Framework Core are installed. The Entity Framework 6 tools are running. Use 'EntityFrameworkCore\Enable-Migrations' for Entity Framework Core.
A version of Entity Framework older than 6.3 is also installed. The newer tools are running. Use 'EntityFramework\Enable-Migrations' for the older version.
No context type was found in the assembly 'Trabalho Lab Aplicações Web'.
Which I partially understand cause it wants a class inherint fro DbContext, but my context inherits from IdentityDbContext. What should I do?
8 Replies
Mayor McCheese
Mayor McCheese11mo ago
I mean what have you tried? It suggests that you prefix your command.
Gipper
GipperOP11mo ago
ChatGpt told me to do
PM> EntityFrameworkCore\Add-Migration nullableForeignsOnPublicacao
PM> EntityFrameworkCore\Add-Migration nullableForeignsOnPublicacao
to remove ambiguity of which version of EFCore to use And it worked
Mayor McCheese
Mayor McCheese11mo ago
It's literally in the message returned
Gipper
GipperOP11mo ago
pff, lol, yeah I just automatically don't read error messages I'll try to start reading them, then
Mayor McCheese
Mayor McCheese11mo ago
It's worth reading error messages. They frequently include useful information 🤣
Gipper
GipperOP11mo ago
no bully sadge
Mayor McCheese
Mayor McCheese11mo ago
if you're happy with your answer and solution $close ¯\_(ツ)_/¯
MODiX
MODiX11mo ago
Use the /close command to mark a forum thread as answered
Want results from more Discord servers?
Add your server