visual-studiovisual-studio-2017package-manager-console

Can not run add-migration or update-database after updating Visual Studio 2017


I'm working on a solution that has multiple projects, one of these projects is for generating migration code, every thing was working fine until I updated the VS to the latest release 15.5.7.

Now when I try to run the Add-migration it does nothing, no code generate, no error messages, just load the prompt again like below:

Please advice as I'm stuck and can not do anything.


Solution

  • I found the solution for the problem, I had to first update some packages

    Microsoft.AspNetCore.All 
    Microsoft.EntityFrameworkCore.Tools 
    Microsoft.VisualStudio.Web.CodeGeneration.Design 
    

    Then Edit your .csproj file by adding this line

      <PropertyGroup>
        <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
      </PropertyGroup>