DACPAC Deployment Powershell issue

Deploying my DACPAC to teamCity is triggering a build on my production environment, and when the NuGet package with my DACPAC reaches there it fails out saying:

Exception calling “Deploy” with “4” argument(s):
"An error occurred during deployment plan generation. Deployment cannot continue."
At Deploy.ps1:60 char:2
$d.Deploy($dp, $dbName, $TRUE, $dacProfile.DeployOptions)

CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException
FullyQualifiedErrorId : DacServicesException

Attached is the Deploy.ps1 file, and the Database.publish.xml file.

Do you have any ideas as to how to fix this?

<a class="attachment" href="//octopus-help.s3-us-west-2.amazonaws.com/original/2X/c/c7267ef9472fb74769087ca3662f6ced98daa77f.xml">Database.publish.xml</a> (546 Bytes)

<a class="attachment" href="//octopus-help.s3-us-west-2.amazonaws.com/original/2X/0/032a7deb5b058bb2335ad2f6ac7481255363f607.ps1">Deploy.ps1</a> (1 KB)

Never mind, I figured it out by adding a try catch block like so:

try
{
	# Deploy the dacpac
	$d.Deploy($dp, $dbName, $TRUE, $dacProfile.DeployOptions)
}
catch
{
	Write-Host "LoadException";
	$Error | format-list -force
	Write-Host $Error[0].Exception.ParentContainsErrorRecordException;
}

Doing this told me that the sqlproj file was aimed at Sql Server 2014, while the database being deployed to was Sql Server 2012.

Hi Michelle,

Thanks for getting in touch. Glad you got it sorted.

Cheers
Mark