问题描述
大家好,我叫Taniguchi,我学习asp.net核心,我设法创建了一个迁移,但是当我使用Update-Database命令时,向我显示以下错误:“
指定'-Verbose'标志以查看应用于目标数据库的SQL语句。 在程序集“ WebApplication1”中找不到迁移配置类型。 (在Visual Studio中,您可以使用Package Manager控制台中的Enable-Migrations命令来添加迁移配置。)
我的数据库:
public class MimicContext : DbContext
{
public MimicContext(DbContextOptions<MimicContext> options) : base(options)
{
}
public DbSet<Palavra> Palavras { get; set; }
}
我的创业公司:
public class Startup
{
// This method gets called by the runtime. Use this method to add services to the container.
// For more information on how to configure your application,visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<MimicContext>(opt =>
{
opt.UseSqlite("Data Source=Database\\Mimic.db");
});
services.AddMvc(options => options.EnableEndpointRouting = false);
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app,IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseMvc();
}
}
如何配置到程序集的迁移?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)