Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity framework commands not available when switching to another PC

I have PC1, which I install packages on, when I get my code from Version control on PC2, I get the error message: "Add-Migration" and "Update-Database" "is not recognized as the name of a cmdlet, function, script file" etc.

I've looked at other posts here, but nothing helped. It only happens when I switch PC's and it can be fixed by uninstalling and reinstalling the package.

I also get an issue, that says, the package isn't digitally signed, which I can get around by doing a Set-ExecutionPolicy Bypass -Scope Process but it is very annoying.

How can I fix/prevent this permeanently?

like image 697
williamsandonz Avatar asked Dec 06 '25 06:12

williamsandonz


1 Answers

If you use package restore, go to Package Manager Settings and set "Allow NuGet to download missing packages during build", then build your project or restore your packages. After that, restart Visual Studio and the commands should work.

like image 179
Murilo Giacometti Avatar answered Dec 08 '25 21:12

Murilo Giacometti



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!