© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
2 replies
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
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.
No DbContext named 'RPGContext' was found.

Or with full path
No DbContext named 'SadBot.Core.Database.RPGContext' was found.
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
SadBot (solution)
    -/SadBot.Core
           -/Database
              -/Entity.cs
              -/RPGContext.cs
    -/SadBot.Migrations
    -/SadMemerBot (Startup proj)
       -/Program.cs
YouTubeDapper Dino
How To Make A C# Discord Bot - Creating A Database - Part 10
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...
How To Make A C# Discord Bot - Creating A Database - Part 10
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

EF Core not creating migrations
C#CC# / help
14mo ago
Problem while "dotnet ef migrations add Init"
C#CC# / help
2y ago
✅ Layered architecture EF Core error when creating migrations
C#CC# / help
3y ago
DDD Dotnet-ef 8 error/bug? Making migrations breaks build in dotnet 8
C#CC# / help
3y ago