EF Code First - Timeout expired. The timeout period elapsed prior to completion

后端 未结 6 1173
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-06 23:34

Apology for this strangely worded question. I don\'t know what the actual problem is but hopefully someone can give me some insights.

I am getting the following error wh

6条回答
  •  别那么骄傲
    2021-02-07 00:05

    An FYI EF Migrations pull their timeout from a separate configuration:

    public class MyContextConfiguration : DbMigrationsConfiguration
    {
        public MyContextConfiguration()
        {
            CommandTimeout = 900;
        }
    }

    Change the 900 to a something higher, all of the other SQL timeout changes (web.config, etc.) did not do anything, this worked for me.

提交回复
热议问题