I think I’ve got all my dependencies running 1.1 properly but when I try to follow the steps here https://docs.microsoft.com/en-us/ef/core/get-started/aspnetcore/new-db I get an error running the Add-Migration command.
PM> Add-Migration InitialState
An error occurred while calling method ‘ConfigureServices’ on startup class ‘Startup’.
Consider using IDbContextFactory to override the initialization of the DbContext at design-time. Error: This method could not find a user secret ID because the application’s entry assembly is not set. Try using the “.AddUserSecrets(Assembly assembly)” method instead. No parameterless constructor was found on ‘ApplicationDbContext’. Either add a parameterless constructor to ‘ApplicationDbContext’ or add an implementation of ‘IDbContextFactory’ in the same assembly as ‘ApplicationDbContext’.
relevant sections of my project.json: …
“Microsoft.EntityFrameworkCore”: “1.1.0”,
“Microsoft.EntityFrameworkCore.SqlServer”: “1.1.0”,
“Microsoft.EntityFrameworkCore.Design”: {
“type “: “build”,
“version”: “1.1.0”
},
“Microsoft.EntityFrameworkCore.Tools”: “1.1.0-preview4-final”
},
“tools”: {
“Microsoft.EntityFrameworkCore.Tools.DotNet”: “1.1.0-preview4-final”
},
My ApplicationDbContext does have the constructor:
public ApplicationDbContext(DbContextOptions options) : base(options)
{ }
and my Startup.cs does have the:
services.AddDbContext(options => options.UseSqlServer(Configuration.GetConnectionString(“DefaultConnection”)));
What else can it be?