user3536680
user3536680

Reputation: 31

DacFx and Custom DeploymentContributor (AgileSqlClub.DeploymentFilterContributor)

I've tried at least a dozen or so ways to get the module to load and work but still get the same error: 

Error SQL0: Required contributor with id 'AgileSqlClub.DeploymentFilterContributor' could not be loaded.

I've tried to run it with DacFax/SqlPackage 150 (x64) and 140 (Both x86 and x64). All iterations of SqlPackage command attempted:

  1. Full Path to DLL 150 DacFx 

    "C:\Program Files\Microsoft SQL Server\150\DAC\bin\sqlpackage.exe" /a:Publish /SourceFile:C:\work\somedb.dacpac /TargetConnectionString:"Server=tcp:somedb.database.windows.net,1433;" /p:ExcludeObjectTypes="Users;Permissions;Logins;RoleMembership" /p:VerifyDeployment=False /p:AllowIncompatiblePlatform=True /p:TreatVerificationErrorsAsWarnings=True /p:AdditionalDeploymentContributorPaths="C:\Program Files\Microsoft SQL Server\150\DAC\bin\Extensions\AgileSqlClub.SqlPackageFilter.dll" /p:AdditionalDeploymentContributors=AgileSqlClub.DeploymentFilterContributor /p:AdditionalDeploymentContributorArguments="SqlPackageFilter0=IgnoreName(.PainInTheRearFunction.)"

  2. Full Path to Dir w DLL 150 DacFx 

    "C:\Program Files\Microsoft SQL Server\150\DAC\bin\sqlpackage.exe" /a:Publish /SourceFile:C:\work\somedb.dacpac /TargetConnectionString:"Server=tcp:somedb.database.windows.net,1433;" /p:ExcludeObjectTypes="Users;Permissions;Logins;RoleMembership" /p:VerifyDeployment=False /p:AllowIncompatiblePlatform=True /p:TreatVerificationErrorsAsWarnings=True /p:AdditionalDeploymentContributorPaths="C:\Program Files\Microsoft SQL Server\150\DAC\bin\Extensions" /p:AdditionalDeploymentContributors=AgileSqlClub.DeploymentFilterContributor /p:AdditionalDeploymentContributorArguments="SqlPackageFilter0=IgnoreName(.PainInTheRearFunction.)" 

  3. No Path 150 DacFx   

    "C:\Program Files\Microsoft SQL Server\150\DAC\bin\sqlpackage.exe" /a:Publish /SourceFile::C:\work\somedb.dacpac /TargetConnectionString:"Server=tcp:somedb.database.windows.net,1433;" /p:ExcludeObjectTypes="Users;Permissions;Logins;RoleMembership" /p:VerifyDeployment=False /p:AllowIncompatiblePlatform=True /p:TreatVerificationErrorsAsWarnings=True /p:AdditionalDeploymentContributors=AgileSqlClub.DeploymentFilterContributor /p:AdditionalDeploymentContributorArguments="SqlPackageFilter0=IgnoreName(.PainInTheRearFunction.)"

  4. 140 DacFx x86 (Doesn't support Additional Path Argument) 

    "C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin\sqlpackage.exe" /a:Publish /SourceFile:C:\work\somedb.dacpac /TargetConnectionString:"tcp:somedb.database.windows.net,1433;" /p:ExcludeObjectTypes="Users;Permissions;Logins;RoleMembership" /p:VerifyDeployment=False /p:AllowIncompatiblePlatform=True /p:TreatVerificationErrorsAsWarnings=True  /p:AdditionalDeploymentContributors=AgileSqlClub.DeploymentFilterContributor /p:AdditionalDeploymentContributorArguments="SqlPackageFilter0=IgnoreName(.PainInTheRearFunction.)"

  5. 140 DacFx x64 (Doesn't support Additional Path Argument) 

    "C:\Program Files\Microsoft SQL Server\140\DAC\bin\sqlpackage.exe" /a:Publish /SourceFile:C:\work\somedb.dacpac /TargetConnectionString:" tcp:somedb.database.windows.net,1433;" /p:ExcludeObjectTypes="Users;Permissions;Logins;RoleMembership" /p:VerifyDeployment=False /p:AllowIncompatiblePlatform=True /p:TreatVerificationErrorsAsWarnings=True  /p:AdditionalDeploymentContributors=AgileSqlClub.DeploymentFilterContributor /p:AdditionalDeploymentContributorArguments="SqlPackageFilter0=IgnoreName(. PainInTheRearFunction.)"

Where I've tried to put the dll and pdb file:

I am using the release version of the AgileSqlClub Deployment Contributor downloaded in zip format from here:

I've read a dozen or so articles including:

I am not using SSDT just downloaded versions of DacFramework.msi (140/150)

If I remove the DeploymentFilter arguments then SqlPackage loads everything but fails at the PainInTheRearFunction I am trying to filter and Ignore on.

Any help would be greatly appreciated.

Upvotes: 3

Views: 1171

Answers (1)

johncyril
johncyril

Reputation: 172

I had the same issue. Lots of those links referred to "unblocking" the dll which I originally dismissed, thinking things had moved on since versions of windows that were referenced.

I still needed to do this. Screenshot below to illustrate. Having the AgileSqlClub.SqlPackageFilter.dll in the same folder as SqlPackage.exe was where it worked

Dll Properties

Upvotes: 3

Related Questions