C
C#2d ago
Faker

✅ Project not found when trying to add migration in rider

Hello guys, whenever I try to add a migration in rider, using its terminal, I get the following error:
No project was found. Change the current working directory or use the --project option.
No project was found. Change the current working directory or use the --project option.
Can someone explain what this error is due to please. What I tried, is I switch to the folder where my dbContext is, for example in a folder called data, even then, I get this error. The thing which makes it work is, initially I'm in the solution directory, something like that: C:\Users\{user}\RiderProjects\Learning I just switch to C:\Users\{user}\RiderProjects\Learning\Learning Then it worked. So I have a few questions, initially we are always in the solution folder? I'm confused, how does it differ, like Learning/Learning are both the same things ? why there aren't name conflicts? Second thing, does rider has a package manager console like visual studio where we can omit the dotnet command ? Last question where is the .csproj found in rider please, I can't see it
No description
10 Replies
Pobiega
Pobiega2d ago
dotnet commands need to be executed from within the project dir, or specify the project. that said, Rider has excellent EF Core tooling built in I'd recommend just using that
Pobiega
Pobiega2d ago
Thats your csproj
No description
Faker
FakerOP2d ago
oh ok yeahh, just saw that, it has in-built function to add migration and scaffolding
Angius
Angius2d ago
To answer your second question, yes, Rider does have a terminal built-in
Keswiik
Keswiik2d ago
the terminal will default the CWD to your solution folder though, afaik
Faker
FakerOP2d ago
yep but that's not the same as visual studio I think no? Like we need to manually install dotnet something
Pobiega
Pobiega2d ago
the package-manager console is not a normal terminal it has a bunch of weird stuff pre-loaded Rider does no such thing
Faker
FakerOP2d ago
yep I see will just stick with the UI options Thanks !
Pobiega
Pobiega2d ago
to be fair, the UI thingy shows you the dotnet command it will run so you can see what it does very helpful when you have more than 1 context, etc
Faker
FakerOP2d ago
yeah just saw that, it was a length string 😂 oh ok, I will have a look then Thanks once more 👍

Did you find this page helpful?