.net core VS 2015-EF迁移命令

.net core VS 2015-EF迁移命令,.net-core,.net Core,执行实体框架迁移时出现以下错误 dotnet.exe:System.ArgumentNullException:值不能为null。第1行字符:1 +dotnet ef-在此处输入代码-启动项目../Bloomerang.Web迁移添加评估问题 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +CategoryInfo:NotSpecified:(System.Argument…不

执行实体框架迁移时出现以下错误

dotnet.exe:System.ArgumentNullException:值不能为null。第1行字符:1 +dotnet ef-
在此处输入代码
-启动项目../Bloomerang.Web迁移添加评估问题 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +CategoryInfo:NotSpecified:(System.Argument…不能为空。:String)[],RemoteException +FullyQualifiedErrorId:NativeCommandError

参数名称:connectionString

位于Microsoft.EntityFrameworkCore.Utilities.Check.NotEmpty(字符串值,字符串参数名称)

在Microsoft.EntityFrameworkCore.SqlServerDbContextOptionsExtensions.UseSqlServer(DBContextOptionsBuilderOptionsBuilder,字符串连接字符串,操作'1 sqlServerOptionsAction)

在Bloomerang.Web.Startup.b_uuu4_u0(dbcontextoptions构建器选项)

在Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.DbContextOptions工厂[TContext](IServiceProvider应用程序服务提供程序,操作'2 选择(行动)

位于Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider提供程序)

位于Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider提供程序,键入serviceType)

位于Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider提供程序)

位于Microsoft.Extensions.DependencyInjection.ServiceProvider.ScopedCallSite.Invoke(ServiceProvider提供程序)

位于Microsoft.Extensions.DependencyInjection.ServiceLookup.ClosedIEnumerableService.CallSite.Invoke(ServiceProvider)

位于Microsoft.Extensions.DependencyInjection.ServiceProvider.TransientCallSite.Invoke(ServiceProvider提供程序)

位于Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider提供程序,键入serviceType)

位于Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider提供程序)

在Microsoft.EntityFrameworkCore.Design.DbContextOperations.FindContextTypes()中

位于Microsoft.EntityFrameworkCore.Design.DbContextOperations.FindContextType(字符串名称)

位于Microsoft.EntityFrameworkCore.Design.DbContextOperations.CreateContext(字符串contextType)

位于Microsoft.EntityFrameworkCore.Design.MigrationsOperations.AddMigration(字符串名称、字符串输出目录、字符串上下文类型)

在Microsoft.EntityFrameworkCore.Tools.Cli.MigrationsAddCommand.Execute(CommonOptions CommonOptions、字符串名称、字符串输出目录、字符串上下文、字符串环境、操作'1 (记者)

在Microsoft.EntityFrameworkCore.Tools.Cli.MigrationsAddCommand.c__DisplayClass0_0.b__0()中

位于Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(字符串[]args)

位于Microsoft.EntityFrameworkCore.Tools.Cli.Program.Main(字符串[]args)

值不能为null


参数名称:connectionString

使您的appsettings.json类似于以下内容:

{
  "ConnectionStrings":
  {
  "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=ContosoUniversity1;Trusted_Connection=true;MultipleActiveResultSets=true"
  },
"Logging":
  {
    "IncludeScopes": false,
    "LogLevel":
    {
      "Default": "Warning"
    }
  }
}