我正试着在Ubuntu 17.04
上启动.Net Core 2.0
个应用程序.我之前是在Windows10上开发的,运行得很好.问题是,当我运行dotnet ef database update
时,我得到下一个异常:
System.PlatformNotSupportedException: LocalDB is not supported on this Platform.
这是我的DbContext
美元:
public class NutritionContext : DbContext
{
public DbSet<User> Users { get; set; }
public DbSet<Meal> Meals { get; set; }
public DbSet<Dish> Dishes { get; set; }
public DbSet<Product> Products { get; set; }
public DbSet<Plan> Plans { get; set; }
public DbSet<MealDish> MealDishes { get; set; }
public DbSet<Ingredient> Ingredients { get; set; }
public DbSet<PlanDetail> PlanDetails { get; set; }
public DbSet<UserPlan> UserPlans { get; set; }
public DbSet<AuthUser> AuthUsers { get; set; }
public NutritionContext()
{
}
public NutritionContext(DbContextOptions options) : base(options)
{
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer(
"Server=(localdb)\\mssqllocaldb;Database=NutritionDatabaseNew;Trusted_Connection=True;MultipleActiveResultSets=true");
}
}
你知道这可能是什么原因吗?