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
How did you transfer the database?
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?
Sure, you can recreate the structure with migrations
What are the errors exactly?
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 hourdotnet 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 itI 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: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.
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 ideaUnknown User•11mo ago
Message Not Public
Sign In & Join Server To View
no...should I run it on both systems?
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
I ran restore on both, still getting same response from update comman
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
yeah
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
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•11mo ago
Message Not Public
Sign In & Join Server To View
even the aspnet identity tables?
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
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•11mo ago
Message Not Public
Sign In & Join Server To View
ok how? update-database still gives the same bad response
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
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/
this isn't c# code tho, it's console text
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
oh, but the 3 backticks still makes it look better lol
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Developer PowerShell in MS Visual Studio is fine right? It's still powershell just integrated into the VS GUI
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
it doesnt
and the command ran fine
says done
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
should I try update-database again?
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Idk, what should I do to check?
Try to run app?
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
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•11mo ago
Message Not Public
Sign In & Join Server To View
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•11mo ago
Message Not Public
Sign In & Join Server To View
Thanks a whole lot, guys ❤️
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
sounds like money, which I don't have 😆
MSSQL Server
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View