报错原因因为你在依赖注入使用的是连接池AddDbContextPool,则不能在OnConfiguring配置参数 需要在AddDbContextPool中完成配置
builder.Services.AddDbContextPool<MyDbContext>(options => { options.UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking); options.UseSqlServer("xxxx"); });
标签:used,when,modify,OnConfiguring,System,AddDbContextPool,InvalidOperationException From: https://www.cnblogs.com/hljjway/p/17214986.html