2

I wondered if someone could perhaps help save my sanity by telling me what I'm missing here. The background first.

We have 5 database projects in TC, each with a build step and then a deploy step. 4 out of these 5 projects build and deploy perfectly.

The 5th however build ok but then raises the following error during deployment to the its SQL Server;


"*** An error occurred during deployment plan generation. Deployment cannot continue."

The Element or Annotation class PersistedResolvableAnnotation does not contain the Property class Length.

[08:32:52][Exec] C:\TeamCity\BuildAgent3\work\c3c1bdeecddf68ca.Build\dbdeploy_single.proj(9, 5): error MSB3073: The command ""C:\Program Files (x86)\Microsoft SQL Server\120\DAC\Bin\sqlpackage.exe" /Action:Publish /sf:"../DB-ExampleData/ExampleData/bin/Release/ExampleData.dacpac" /pr:"../DB-ExampleData/ExampleData/UAT.publish.xml" /TargetServerName:IP.IP.IP.111" exited with code 1.


During my investigation I compared the UAT.publish.xml to one that works and they seem identical. I've tried Windows Authentication and SQL Authentication and that makes no difference either. The publish file works fine when run from within Visual Studio as well.

I've checked the deploy settings between the projects that work and this one and the only difference I can see is in the database name which is expected.

Has anyone got any ideas on what this may be caused by and how I can resolve it. I have logs and screenshots if needed.

Thanks for taking the time to read this.

Nic

user3060571
  • 103
  • 2
  • 7
  • The issue appears to be with sqlpackage when called for the dacpac it gives the error regardless of publish file. Other deployments done directly with sqlpackage are successful. I've no idea how to resolve it so I'm going to try and ensure its the latest version (if I can find the download link). – user3060571 Nov 16 '16 at 15:40

2 Answers2

2

It looks as if your build server has a different version of sqlpackage (i.e. DacFX) than the one that Visual Studio is using, and only one of your five projects contains whatever feature is handled "differently" by the two versions.

There's a bit of detail in this msdn thread.

In short, I'd be updating DacFX on the build server, and making sure the build job is calling the sqlpackage.exe that is in

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\130

Gavin Campbell
  • 796
  • 5
  • 19
0

In my case SQLCLR on .NET version was different in the project Properties. Thanks @Gavin for pointing on right direction. And corrected "Compatibility Level"

Khalid Mammadov
  • 511
  • 4
  • 6