RAJNIK PATEL
RAJNIK PATEL

Reputation: 1049

Could not deploy package "Microsoft.SqlServer.Dac.DacServicesException"

I am using the C# DacPac Service to Update Database.

Same code successfully working while run dacpac file for update database in sql server 2012 through c# but not working in sql server 17.9.1.

I am encountering the below error when attempting to update a DACPAC file to a SQL Server v17.9.1.

Microsoft.SqlServer.Dac.DacServicesException
Message : Could not deploy package.
StackTrace :    at Microsoft.SqlServer.Dac.DeployOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)
   at Microsoft.SqlServer.Dac.OperationExtension.Execute(IOperation operation, DacLoggingContext loggingContext, CancellationToken cancellationToken)
   at Microsoft.SqlServer.Dac.DacServices.InternalDeploy(IPackageSource packageSource, Boolean isDacpac, String targetDatabaseName, DacDeployOptions options, CancellationToken cancellationToken, DacLoggingContext loggingContext)
   at Microsoft.SqlServer.Dac.DacServices.Deploy(DacPackage package, String targetDatabaseName, Boolean upgradeExisting, DacDeployOptions options, Nullable`1 cancellationToken)
   at VersionUpgradedacpac.Form1.Deploy(String DatabaseFilePath, String ConnectionString, String deployDatabaseName) in D:\dev\ProteaPhase1\ProteaExtractUpdateUtility\ProUpdateUtility\Form1.cs:line 555
Microsoft.Data.Tools.Schema.Sql.Deployment.DeploymentFailedException
Message : Unable to connect to target server.
StackTrace :    at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentEndpointServer.OnInit(ErrorManager errors, String targetDBName)
   at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment..ctor(SqlDeploymentConstructor constructor)
   at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentConstructor.ConstructServiceImplementation()
   at Microsoft.SqlServer.Dac.DacServices.CreatePackageToDatabaseDeployment(String connectionString, IPackageSource packageSource, String targetDatabaseName, DacDeployOptions options, ErrorManager errorManager)
   at Microsoft.SqlServer.Dac.DeployOperation.<>c__DisplayClass3.<>c__DisplayClass5.<CreatePlanInitializationOperation>b__1()
   at Microsoft.Data.Tools.Schema.Sql.Dac.OperationLogger.Capture(Action action)
   at Microsoft.SqlServer.Dac.DeployOperation.<>c__DisplayClass3.<CreatePlanInitializationOperation>b__0(Object operation, CancellationToken token)
   at Microsoft.SqlServer.Dac.Operation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)
   at Microsoft.SqlServer.Dac.ReportMessageOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)
   at Microsoft.SqlServer.Dac.OperationExtension.CompositeOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)
   at Microsoft.SqlServer.Dac.OperationExtension.CompositeOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)
   at Microsoft.SqlServer.Dac.DeployOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)

Upvotes: 1

Views: 4041

Answers (1)

Manfred Wippel
Manfred Wippel

Reputation: 2066

Update your DAC libraries and install the latest sqlpackage version. Also make sure your script points to the correct libraries.

Upvotes: 1

Related Questions