Getting an error :Add-Migration : The term 'Add-Migration' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Shyamali Mishra 0 Reputation points
2023-05-19T13:51:47.28+00:00

Tried trouble shooting , verfied DB context class. Reinstalled Vs after troubleshooting and getting answers saying there is a problem with package manager .

Developer technologies .NET Entity Framework Core
Windows for business Windows Client for IT Pros User experience Other
SQL Server Other
Developer technologies C#
{count} votes

2 answers

Sort by: Most helpful
  1. Hemant Dubey 25 Reputation points
    2023-10-17T07:09:47.1233333+00:00

    install Microsoft.EntityFrameworkCore.Tools from NuGet packages, then try to run Add-Migration on the package manager console. Hope it helps.

    5 people found this answer helpful.

  2. Anonymous
    2023-05-22T01:19:02.7+00:00

    Hi

    Add-Migration is part of Microsoft.EntityFrameworkCore.Tools. You can install the package from NuGet.

    dotnet add package Microsoft.EntityFrameworkCore.Tools --version 7.0.5
    

    https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.Tools/

    Best Regards,

    Ian Xue

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    3 people found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.