Code first custom SQL migration timeout exception

ぃ、小莉子 提交于 2019-11-28 10:46:15

Use Configuration.cs file to set custom time out:

internal sealed class Configuration : DbMigrationsConfiguration<ApplicationDbContext>
{
    public Configuration()
    {
        AutomaticMigrationsEnabled = false;
        ContextKey = "YourDbContext";

        // New timeout in seconds
        this.CommandTimeout = 60 * 5; 
    }
}
shivakumar

Your request processing may be taking more time than default command timeout of entity framework(30 sec). You can increase command timeout if necessary as in thread below.

Entity Framework Timeouts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!