title: I cannot create migrations in ASP.NET Core. What is the solution?
body: <p>Visual Studio 2019 Community. I want to create a table to create the migrations and connect with SQL Server 2014. But when I run </p>
  
  <pre><code>add-migrations AddMusicStoreToDb
  </code></pre>
  
  <p>I get an error:</p>
  
  <blockquote>
    <p>add-migrations: The term 'add-migrations' 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.</p>
    
    <p>At line: 1 char: 1<br>
    + add-migrations AddMusicStoreToDb<br>
    + ~~~~~~~~~~~~~~~<br>
    + CategoryInfo: ObjectNotFound: (add-migrations: String) [], CommandNotFoundException<br>
    + FullyQualifiedErrorId: CommandNotFoundException  </p>
    
    <hr>
  </blockquote>
  
  <p><code>appsettings.json</code>:</p>
  
  <pre><code>{
    "ConnectingStrings": {
      "DefaultConnection": "Server=DESKTOP-NHG0GU1\\SQLEXPRESS;Database=MusicStoreList  ;Trusted_Connection=True;MultipleActiveResultSets=true;"
    },
  
    "Logging": {
      "LogLevel": {
        "Default": "Information",
        "Microsoft": "Warning",
        "Microsoft.Hosting.Lifetime": "Information"
      }
    },
    "AllowedHosts": "*"
  }
  </code></pre>
  
  <p>MusicStoreListContext.cs:</p>
  
  <pre><code>using Microsoft.EntityFrameworkCore;
  
  namespace MusicStoreRazor.UI.Models
  {
      public class MusicStoreListContext:DbContext
      {
          public MusicStoreListContext(DbContextOptions&lt;MusicStoreListContext&gt; options):base(options)
          {
  
          }
          public DbSet&lt;Music&gt; Musics { get; set; }
      }
  }
  </code></pre>
  
  <p>Startup.cs</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Threading.Tasks;
  using Microsoft.AspNetCore.Builder;
  using Microsoft.AspNetCore.Hosting;
  using Microsoft.AspNetCore.HttpsPolicy;
  using Microsoft.EntityFrameworkCore;
  using Microsoft.Extensions.Configuration;
  using Microsoft.Extensions.DependencyInjection;
  using Microsoft.Extensions.Hosting;
  using Microsoft.Extensions.Options;
  using MusicStoreRazor.UI.Models;
  
  namespace MusicStoreRazor.UI
  {
      public class Startup
      {
          public Startup(IConfiguration configuration)
          {
              Configuration = configuration;
          }
  
          public IConfiguration Configuration { get; }
  
          // This method gets called by the runtime. Use this method to add services to the container.
          public void ConfigureServices(IServiceCollection services)
          {
              services.AddDbContext&lt;MusicStoreListContext&gt;(options =&gt; options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
              services.AddRazorPages().AddRazorRuntimeCompilation();
          }
  
          // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
          public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
          {
              if (env.IsDevelopment())
              {
                  app.UseDeveloperExceptionPage();
              }
              else
              {
                  app.UseExceptionHandler("/Error");
                  // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                  app.UseHsts();
              }
  
              app.UseHttpsRedirection();
              app.UseStaticFiles();
  
              app.UseRouting();
  
              app.UseAuthorization();
  
              app.UseEndpoints(endpoints =&gt;
              {
                  endpoints.MapRazorPages();
              });
          }
      }
  }
  </code></pre>