SsdtHelper.DeployDacPacWithOptions() fails with System.MissingMethodException: Method not found: 'Void Microsoft.SqlServer.TransactSql'

Ron Anoshi 10 Reputation points

I have a .NET Framework 4.6.1 (upgrading to 4.6.2 doesn't solve it) project that uses DacServices to deploy my database's SSDT on a Docker container.
This eventually uses the following code:

using (var fileStream = new FileStream(dacpacPath, FileMode.Open, FileAccess.Read))
            using (var dbPackage = DacPackage.Load(fileStream, DacSchemaModelStorageType.Memory, FileAccess.Read))
                return dbServices.GenerateDeployScript(dbPackage, targetDbName, dbDeployOptions);

This line fails with the following error:

  Message=Method not found: 'Void Microsoft.SqlServer.TransactSql.ScriptDom.SqlScriptGeneratorOptions.set_AllowExternalLibraryPaths(Boolean)'.
   at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentPlanGenerator.ScriptGeneratorFacade..ctor(DeploymentContext context, Func`1 getTargetDboUserSecurityId)
   at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentPlanGenerator.OnInitialize(SqlDeployment engine)
   at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.InitializePlanGeneratator()
   at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.CreateController(Action`1 msgHandler)
   at Microsoft.SqlServer.Dac.DacServices.CreateController(SqlDeployment deploymentEngine, ErrorManager errorManager)
   at Microsoft.SqlServer.Dac.DacServices.<>c__DisplayClass30.<CreateDeploymentArtifactGenerationOperation>b__2e(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.GenerateDeployScript(DacPackage package, String targetDatabaseName, DacDeployOptions options, Nullable`1 cancellationToken)
   at Payoneer.ServicesInfra.TestingUtils.DbSsdtDeployer.SsdtHelper.CreateSsdtDeployScript(String dacpacPath, String targetDbName, DacDeployOptions dbDeployOptions, DacServices dbServices) in...

This somehow passes on the build server and someone else's machine, so it's likely a version mismatch, but of what, and how?
Help appreciated.

Microsoft Technologies based on the .NET software framework.
3,193 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,319 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Ron Anoshi 10 Reputation points

    Hi all,

    Posting a temporary fix for this which worked for me (and some others):
    Delete the following DLL (need to close VS & SSMS for this):


    And rerun your failing code.

    Thanks to Batia P. who found this fix.

    2 people found this answer helpful.
    0 comments No comments

  2. Zohar Gelman Biran 0 Reputation points

    The same issue is happening to me.

    The DacDeployOptions I set are:

    • CreateNewDatabase = true
    • BlockOnPossibleDataLoss = false
    • BlockWhenDriftDetected = false
    • Some SqlCommandVariableValues: DefaultDataPath, SSDT_repo, debug.

    The failure happens when calling the DacServices.GenerateDeployScript(..).
    Also, for some reason the same code works when running on .Net Core 3.1

    0 comments No comments

  3. Seeya Xi-MSFT 16,416 Reputation points

    Hi @Ron Anoshi ,

    This error typically occurs when there is a mismatch between the version of the SQL Server Data Tools (SSDT) that you are using and the version of the SQL Server you are targeting. The AllowExternalLibraryPaths property was introduced in a later version of SQL Server than the version you are targeting.

    To resolve this issue, you should ensure that you are using a version of SSDT that is compatible with the version of SQL Server you are targeting. You may need to update either SSDT or SQL Server to a compatible version.

    Please refer to this:

    If this does not help you, you can add more information, such as the SSDT version.

    Best regards,


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".