VS2022 errors out on a project cloned from Git

I'm getting the below error while trying to launch a project that we're supposed to work on as a group. We've worked a bit with ASP.NET and VS2022 in general before that, but never adding Git into the mix, and unfortunately this just stops me before I can even do anything. If I understand correctly from the error, the code is looking for a local database, which doesn't exist. I suppose my question is - how do I make one? In my previous projects it just kind of created one by itself, I didn't need to fill it up with tables or anything it just appeared- And no, just adding a new database named accordingly doesn't work either, it then starts throwing errors about individual tables unless those are added also
No description
10 Replies
mg
mg5mo ago
Your understanding is correct. Are there any migrations in the project?
RoboticOperatingBuddy
oh christ the migrations It completely slipped my mind, I should check that
mg
mg5mo ago
Yeah, those are what are responsible for making the database schema match the DbContext
Jimmacle
Jimmacle5mo ago
for a collaborative project you should definitely look into the different configuration options for ASP.NET Core like user secrets to keep machine-specific options out of your repository like which database to connect to either that or use docker to have a consistent environment on all your dev machines
RoboticOperatingBuddy
there were migrations, all I had to do was punch in Update-Database and it worked I feel dumb as hell for not having thought of that earlier, but I also wonder how did I not find that in the hour-or-so I spent googling the issue- tyvm! uff yeah probably I never collaborated with VS2022 so I don't really know what to watch out for and what could break stuff, should probably read up on that
Jimmacle
Jimmacle5mo ago
nothing is particularly IDE specific about the process besides adding VS cache folders to your gitignore (dotnet new gitignore already has this)
RoboticOperatingBuddy
okay I checked the .gitignore, and it seems it's full of default stuff, like ignoring VS-specific stuff like the aforementioned cache folders, so I thiiink I will be alright?
Jimmacle
Jimmacle5mo ago
i mean, that's just for VS you still need to make sure machine-specific files and any private information like passwords aren't committed to the repo user secrets are an easy way to help with that for ASP.NET Core
Jimmacle
Jimmacle5mo ago
RoboticOperatingBuddy
will give that a read through, thanks!