0

I am facing an issue when trying to run a migration. All I am trying to do is change an index in a table, which already has data in it. Package Manager error

I am using Entity framework 6.0 and an Azure SQL database.

I have searched all over the web and tried to add Timeout = 4000 in the connection string, but still no success.

"connectionString="Data Source=;Initial Catalog=;User Id=;Password=***; Connection Timeout=60; Timeout = 4000"

The issue that I am trying to solve is an execution timeout issue. I tried to modify this in the dbcontext: this.Database.CommandTimeout = 180; but still the execution timeout below, is being thrown after just 30 seconds!

user2541516
  • 79
  • 1
  • 9
  • The connection string time out is the length of time allowed to establish a connection, it does not have anything to do with the timeout of a command being executed. – Igor Jan 18 '22 at 16:09
  • Yes @igor, i know that thanks. The issue i am trying to solve is an Execution Timeout and not Connection Timeout. I tried this.Database.CommandTimeout = 180; but still, the execution timeout exception is being thrown in less than 30 seconds! – user2541516 Jan 18 '22 at 16:16
  • 1
    See the marked duplicate, use a `DbMigrationsConfiguration` as shown in the answer. – Igor Jan 18 '22 at 16:18
  • Thank you Igor - this solved it for me – user2541516 Jan 18 '22 at 16:22

0 Answers0