Tiltyboi
✅ Cannot connect to mysql docker container db from AspNet Core App
A AspNet Core App using EF-Core cannot connect to local db container running mysql. I have made sure it forwards the correct port (default 3306). ASet my connection string in my app to:
So why doesnt it work? I alsot ried setting server to localhost and 127.0.0.1 ....
19 replies
EF-Core migrations issue
I have split a large project into multiple places. I have 1 class-library with my classes and contexts, 1 class library where my migrations will go and then my main app.
When i do
Add-Migration init -Project <lib-with-context>
it throws this lovely error:
2 replies
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:
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:
3 replies