I think that I have all my dependencies running 1.1 correctly, but when I try to follow the steps here https://docs.microsoft.com/en-us/ef/core/get-started/aspnetcore/new-db I get a message the error command Add-Migration.
PM> Add-Migration InitialState
An error occurred while calling the "ConfigureServices on startup class" Startup method.
Consider using IDbContextFactory to override DbContext initialization at design time. Error: this method could not find the user secret identifier because the application assembly was not installed. Try using the .AddUserSecrets (Assembly assembly) method instead. no parameterless constructor was found in ApplicationDbContext. Either add the constructor without parameters to ApplicationDbContext or add the implementation of 'IDbContextFactory in the same assembly as' ApplicationDbContext.
Relevant sections of my .json project: ...
"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 has a constructor:
public ApplicationDbContext(DbContextOptions options) : base(options) { }
, and my Startup.cs has:
services.AddDbContext(options => options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
What else could be?
source share