We have created powershell script to deploy our dacpac packages. This script uses Microsoft.SqlServer.Dac.dll library. When I am deploying my dacpac using this powershell script, I am getting following Bug:
.Net SqlClient Data Provider: Msg -2, Level 11, State 0, Line 0 Execution Timeout
Expired. The timeout period elapsed prior to completion of the operation or the server
is not responding. An error occurred while the batch was being executed.
I checked the deployment options for above dll in msdn documentation and added following:
$deployoptions = New-Object Microsoft.SqlServer.Dac.DacDeployOptions
$deployoptions.CommandTimeout =60000
$deployoptions.LongRunningCommandTimeout=0
CommandTimeout deployment option has default value as 0 and i added 60000, but still no effect. whereas LongRunningCommandTimeout deployment option is not getting recognized as valid option and getting following error:
The property 'LongRunningCommandTimeout' cannot be found on this object. Verify that the
property exists and can be set.
My other findings:
- In the latest version of sqlpackage.exe (i.e. 162.0.52.1) I did not get the timeout error while deploying the same dacpac package, but I got the error when I used lower versions (lower than 162.0.52.1) of SQLPackage.exe.
- Using powershell script to deploy the dacpac package, I am getting timeout error for all versions of Microsoft.SqlServer.Dac.dll, which was disheartening for me. Because I was expecting that the latest version (i.e. 162.0.52.1) of this dll should have the fix, just like SQLPackage.exe.
Please suggest the solution of this timeout error, if anyone has found it.