kaspur
kaspur

Reputation: 707

Unable to deploy .dacpac to SQL'16. Method Not found: set_Encryption

I have a dacpac file that is used from SQL 2005 to SQL 2016 databases. Our developers have been using SQL 2016 for the past few months, so we are now moving to production with it.

When attempting to upgrade a database (no previous dacpackage) using our .dacpac file, it will give this error below

===================================

Method not found: 'Void Microsoft.SqlServer.TransactSql.ScriptDom.AlterTableAlterColumnStatement.set_Encryption(Microsoft.SqlServer.TransactSql.ScriptDom.ColumnEncryptionDefinition)'. (Microsoft.Data.Tools.Schema.Sql)

------------------------------
Program Location:

   at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentPlanGenerator.AlterStatementGenerator.GenerateForSimpleColumn(SqlSimpleColumn oldColumn, SqlSimpleColumn newColumn)
   at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentPlanGenerator.AlterStatementGenerator.GenerateAlterTableForColumn(IModelElement oldElement, IModelElement newElement)
   at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentPlanGenerator.AlterStatementGenerator.GenerateStatement(IModelElement oldElement, IModelElement newElement)
   at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentPlanGenerator.Sql90AlterStatementGenerator.GenerateScriptDom(IModelElement oldElement, IModelElement newElement)
   at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentPlanGenerator.DeploymentScriptDomGenerator.GenerateTableAlter(SqlTable sourceTable, SqlTable targetTable)
   at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentPlanGenerator.DeploymentScriptDomGenerator.GenerateFragment(Int32 operation, IModelElement element)
   at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentPlanGenerator.DeploymentScriptDomGenerator.GenerateSteps(Int32 operation, IModelElement element)
   at Microsoft.Data.Tools.Schema.Sql.Deployment.OrderedStepGenerator.Add(DeploymentScriptDomGenerator scriptDom, IModelElement element, Int32 operation)
   at Microsoft.Data.Tools.Schema.Sql.Deployment.Analyzers.PlanMediator.BuildDependencyOrderedSteps(Int32 operation, List`1 classOrder, List`1 operationOrder, Dictionary`2 changes, Boolean preserveGraphs, Dictionary`2& relating, Dictionary`2& related)
   at Microsoft.Data.Tools.Schema.Sql.Deployment.Analyzers.PlanMediator.BuildOperations()
   at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentPlanGenerator.OnGeneratePlan()
   at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentPlanGenerator.GeneratePlan(List`1 drops)
   at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.BuildPlan()
   at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.Controller.CreatePlan()
   at Microsoft.SqlServer.Dac.DacServices.<>c__DisplayClass25.<CreateDeploymentArtifactGenerationOperation>b__23(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.Execute(IOperation operation, DacLoggingContext loggingContext, CancellationToken cancellationToken)
   at Microsoft.SqlServer.Dac.DacServices.GenerateDeployReport(DacPackage package, String targetDatabaseName, DacDeployOptions options, Nullable`1 cancellationToken)
   at Microsoft.SqlServer.Management.Dac.DacWizard.ReviewPlanPage.ActionStepCalculator_DoWork(Object sender, DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

As far as I can tell, we don't have Encryption enabled at all on any of the tables. This is a fresh database. We've even tried recreating it from scratch, but we get the same error once we try to apply the dacpac file.

Does anyone know what I can do to get the server to recognize the set_Encryption method that it seems to be missing? Any suggestions are appreciated.

Edit: I've further determined that it is not a SQL 2016 issue, but rather a SQL Server Management Studio 2016 issue.

Upvotes: 0

Views: 1056

Answers (1)

kaspur
kaspur

Reputation: 707

I was able to get around this error, by first running the dacpac through SqlPackage.exe. After that- I was able to publish through management studio.

Upvotes: 1

Related Questions