Package Manager Console Enable-Migrations CommandNotFoundException only in a specific VS project

前端 未结 26 2962
渐次进展
渐次进展 2020-11-28 06:55

I tried to run the command \'Enable-Migrations\' in a new project and I got the message:

PM> Enable-Migrations
The term \'Enable-Migrations\' is not recog         


        
26条回答
  •  攒了一身酷
    2020-11-28 07:22

    I just had the same problem in asp.net core VS2019

    This solved it:

    Install-Package Microsoft.EntityFrameworkCoreInstall-Package
    Install-Package Microsoft.EntityFrameworkCore.Tools
    

    Don't forget to set default project in Package Manager Console to your database project in case it differs.

    While executing the migrations the default project also seems to play a role. At a later step it helped to install this to my main startup project (not the EF database project):

    Install-Package Microsoft.EntityFrameworkCore.Design
    

提交回复
热议问题