I have simple DbContext with single DbSet:
class SimpleDbContext : DbContext
{
public DbSet<Content> Content { get; set; }
public SimpleDbContext()
{
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer(CloudConfigurationManager.GetSetting("DbConnectionString"));
}
}
Also I have created asp.net core (.net framework) project and class library as data access layer. In Package Manager Console I made data access project as default and web project as start up. I installed Microsoft.EntityFrameworkCore.SqlServer and Microsoft.EntityFrameworkCore.Tools on data access project. But when I ran Add-Migration command package manager said:
PM> add-migration test
This command may fail unless both the targeted project and startup project are ASP.NET Core or .NET Core projects.
Build failed.
I thought it's because I use usual Client Library for data access. I created new Client Library (core) project and did the same things(also updated project.json - added Microsoft.EntityFrameworkCore.Tools to tools section as said in tutorial https://docs.efproject.net/en/latest/platforms/full-dotnet/new-db.html). Line:
This command may fail unless both the targeted project and startup project are ASP.NET Core or .NET Core projects.
Disappeared but Build failed left.
Anyone knows what could it be or how to solve it?