C#C
C#17mo ago
Tiltyboi

dotnet-ef error creating migrations

Im following a youtube tutorial to create a discord bot and in a part the author connects to a database. (vid for reference: https://www.youtube.com/watch?v=EHmtrqb5VMk&list=PLS6sInD7ThM0Zb8F_KBl4T_jGF1e3apsc&index=11)

(P.S excuse my cringe project name)
When im calling the command from CMD its like this:
dotnet-ef migrations add InitialCreate -p ../SadBot.Migrations/SadBot.Migrations.csproj --context SadBot.Core.Database.RPGContext --startup-project ./SadMemerBot.csproj

And then i get this error:
No DbContext named 'RPGContext' was found.
Or with full path No DbContext named 'SadBot.Core.Database.RPGContext' was found.

Im following exactly and linking projects together, saving the csproj files and i can import my class in the program.cs so they are linked.. Why creating migrations doesnt work then?

My Project strucutre is like so:
SadBot (solution)
    -/SadBot.Core
           -/Database
              -/Entity.cs
              -/RPGContext.cs
    -/SadBot.Migrations
    -/SadMemerBot (Startup proj)
       -/Program.cs
YouTubeDapper Dino
Join Our Community: https://student.dapperdino.co.uk/
-----------------------------------------------------------------------------------------------------------
Just Here To Plug My Social Media Stuff:
https://www.patreon.com/dapperdino
https://www.twitch.tv/dapper_dino
https://twitter.com/dapperdino4
https://github.com/DapperDino
https://disco...
Was this page helpful?