The DbContext of type cannot be pooled because it does not have a single public constructor accepting a single parameter of type DbContextOptions

前端 未结 5 636
青春惊慌失措
青春惊慌失措 2020-12-08 11:36

I am trying to upgrade our current .Net Core application from 1.1 to 2.0 and am getting this runtime error: \"The DbContext of type \'CoreContext\' cannot be pooled because

5条回答
  •  情歌与酒
    2020-12-08 12:05

    Try to use AddDbContext instead of AddDbContextPool. This helped me in the same situation. services.AddDbContext(options => options.UseSqlServer(absConnectionString));

提交回复
热议问题