C
C#11mo ago
Gipper

Big problem transfering ASP.NET app from one environment to another

What the title says, I have a desktop computer at home where I do most of my development work and I built an ASP.NET app with EntityFramework and MSSQLServer. In that computer it works fine, problem is I now need to get the app to my laptop and make it work but I'm getting all kinds of problems. I'm pretty sure there's an inconsistency or several between the two databases (the one at home and the one in the laptop). But now when I do update-database it doesn't go through because either I get the error message of EFCore version being wrong or because the project can't build (but the project can't build because I can't apply the migrations and update the database). I'm pretty sure the code itself is exactly equal as I pushed it to github from home and now pulled it down on the laptop. What should I do?
44 Replies
Angius
Angius11mo ago
How did you transfer the database?
Gipper
GipperOP11mo ago
I didn't really, thought I could just do it by using the migration files with update-database But it seems its more complicated then that, huh?
Angius
Angius11mo ago
Sure, you can recreate the structure with migrations What are the errors exactly?
Gipper
GipperOP11mo ago
right now, when I do update-database I get: The EntityFramework package is not installed on project (I also don't know how to install on project and I don't know which version I'm using at home, sowwy) Although I can get back to you on the version being used question in about an hour
Angius
Angius11mo ago
dotnet tool list will show tools installed locally dotnet tool list -g will show tools installed globally It's possible you have dotnet-ef tool installed globally at home, but not installed at all on the other PC If so, dotnet tool install -g dotnet-ef will install it
Gipper
GipperOP11mo ago
I can't continue this today, I'll continue tomorrow thanks for the availability, hopefully you can continue with this tommorrow Yo, I'm back! So here's the output I get from those commands on each system... Desktop: PM> dotnet tool list Package Id Version Commands Manifest --------------------------------------------------- PM> dotnet tool list -g Package Id Version Commands -------------------------------------- dotnet-ef 8.0.0 dotnet-ef PM> dotnet tool install -g dotnet-ef dotnet : Tool 'dotnet-ef' is already installed. At line:1 char:1 + dotnet tool install -g dotnet-ef + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (Tool 'dotnet-ef' is already installed.:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError Laptop: PM> dotnet tool list Package Id Version Commands Manifest --------------------------------------------------- PM> dotnet tool list -g Package Id Version Commands ------------------------------------- PM> dotnet tool install -g dotnet-ef Skipping NuGet package signature verification. You can invoke the tool using the following command: dotnet-ef Tool 'dotnet-ef' (version '8.0.0') was successfully installed. @ZZZZZZZZZZZZZZZZZZZZZZZZZ When I run on desktop it runs fine, yet when I run on laptop, I get this exception:
Gipper
GipperOP11mo ago
Pastebin
ASP.NET Exception - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Gipper
GipperOP11mo ago
mr zzzzs, z-man wassup? Good to see you online 🙂 Ok, strange just to be certain I ran the update-database command on the desktop and I got also: update-database The EntityFramework package is not installed on project 'Proj-name'. Which is strange cause I'm pretty sure I added and applied migrations on this environment When I run the same command on laptop, I get the same exact output, btw I guess, maybe I just didnt apply any EF package to the project itself and it was somehow being run with the global installation on the Desktop?? I have no idea
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
Gipper
GipperOP11mo ago
no...should I run it on both systems?
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
Gipper
GipperOP11mo ago
I ran restore on both, still getting same response from update comman
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
Gipper
GipperOP11mo ago
yeah
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
Gipper
GipperOP11mo ago
On laptop: PM> dotnet install -g dotnet-ef dotnet : Could not execute because the specified command or file was not found. At line:1 char:1 + dotnet install -g dotnet-ef + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (Could not execu... was not found.:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError Possible reasons for this include: * You misspelled a built-in dotnet command. * You intended to execute a .NET program, but dotnet-install does not exist. * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
Gipper
GipperOP11mo ago
even the aspnet identity tables?
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
Gipper
GipperOP11mo ago
Laptop: PM> dotnet tool install -g dotnet-ef dotnet : Tool 'dotnet-ef' is already installed. At line:1 char:1 + dotnet tool install -g dotnet-ef + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (Tool 'dotnet-ef' is already installed.:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
Gipper
GipperOP11mo ago
ok how? update-database still gives the same bad response
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX11mo ago
To post C# code type the following: ```cs // code here ``` Get an example by typing $codegif in chat For longer snippets, use: https://paste.mod.gg/
Gipper
GipperOP11mo ago
PM> update-database
The EntityFramework package is not installed on project 'Trabalho Lab Aplicações Web'.
PM> update-database
The EntityFramework package is not installed on project 'Trabalho Lab Aplicações Web'.
this isn't c# code tho, it's console text
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
Gipper
GipperOP11mo ago
oh, but the 3 backticks still makes it look better lol
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
Gipper
GipperOP11mo ago
Developer PowerShell in MS Visual Studio is fine right? It's still powershell just integrated into the VS GUI
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
Gipper
GipperOP11mo ago
it doesnt and the command ran fine says done
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
Gipper
GipperOP11mo ago
should I try update-database again?
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
Gipper
GipperOP11mo ago
Idk, what should I do to check? Try to run app?
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
Gipper
GipperOP11mo ago
ok, still runs fine on my desktop and it runs fine on laptop too, hurray still the data itself in the db is different because I inputted it manually on desktop through registering users on asp.net identity and other things... which is a problem What should I do about that? Transfer the db on a pen-drive from one computer to another?
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
Gipper
GipperOP11mo ago
Ok, I still have some development to do, which I'll do on desktop. So there probably will be more changes in terms of data in the db, so when I'm ready to transfer I'll google it or create another help thread here
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
Gipper
GipperOP11mo ago
Thanks a whole lot, guys ❤️
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
Gipper
GipperOP11mo ago
sounds like money, which I don't have 😆 MSSQL Server
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server