This article is a mirror article of machine translation, please click here to jump to the original article.

View: 4436|Reply: 0

[Source] The Add-Migration item cannot be recognized as a cmdlet, function, script file

[Copy link]
Posted on 11/27/2022 8:04:34 PM | | |
When creating an initial migration using EF Core, the error is as follows:

PM> Add-Migration InitialCreate
Add-Migration: The Add-Migration item cannot be recognized as the name of a cmdlet, function, script file, or executable program. Please check the spelling of the name and if you include a path, make sure it is correct and try again.
Location Line: 1 Characters: 1
+ Add-Migration InitialCreate
+ ~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Add-Migration:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PM>
solution

Install the Microsoft.EntityFrameworkCore.Tools tool using NuGet with the following command:


ef Perform the Add-Migration error resolution
https://www.itsvse.com/thread-4889-1-1.html


Entity Framework Core Tools Reference - Package Manager Console in Visual Studio:The hyperlink login is visible.
Application migration:The hyperlink login is visible.





Previous:SQL Server query execution result column field data type
Next:SQL Server groups a row of data with the largest (small) value
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com